Doping is considered to be the main method for improving the thermoelectric performance of layered sodium cobaltate (Na1−xCoO2). However, in the vast majority of past reports, the equilibrium location of the dopant in the Na1−xCoO2's complex layered lattice has not been confidently identified. Consequently, a universal strategy for choosing a suitable dopant for enhancing Na1−xCoO2's figure of merit is yet to be established. Here, by examining the formation energy of Gd and Yb dopants in Na0.75CoO2 and Na0.50CoO2, we demonstrate that in an oxygen poor environment, Gd and Yb dopants reside in the Na layer while in an oxygen rich environment these dopants replace a Co in CoO2 layer. When at Na layer, Gd and Yb dopants reduce the carrier concentration via electron-hole recombination, simultaneously increasing the Seebeck coefficient (S ) and reducing electric conductivity (σ). Na site doping, however, improves the thermoelectric power factor (PF) only in Na0.50CoO2. When replacing a Co, these dopants reduce S and PF. The results demonstrate how thermoelectric performance critically depends on the synthesis environment that must be fine-tuned for achieving any thermoelectric enhancement.