My apology. I just realized I gave you an incomplete answer.
It is true that at equilibrium, the Fermi level is the same everywhere in the system.
However, the difference between the Fermi energy and conduction/valence band energy depends not only on the doping concentration but also on the doping profile.
Take, for example, an energy diagram of a p-n junction at equilibrium. This is a case when you have a change of doping concentration. In the n - region and far away from the junction, the conduction band bottom is close to the Fermi level. On the other side (p - region), the top of the conduction band is close to the Fermi level. But in the depletion mode, you have an electrostatic potential that adds to the value of the conduction band bottom (and valence band top).
But in the depletion region, the difference between the bottom of the conduction band and Fermi level changes from the bulk p region value to the bulk n region value. The change of the electron energy is due to potential energy difference because of unbalanced charge in the depletion region.
So, in general, the difference between the energy of a conduction (or valence) band will depend not only on local dopant concentration but also double integrated net charge density. So, given the dopant concentration profile, you really have to solve the Poisson-Boltzmann equation to get the answer.
Henryk