At present, explicit expressions for the electron g factor in crystals are known only for the following two cases: either the Fermi energy e F of the electrons lies at the edge of the electron energy band, e ( ) k ex , or the electron energy spectrum of a crystal can be approximated by the two-band model. Here we obtain explicit formulas for the g factor in situations when the Fermi level e F is close to but does not coincide with the band edge and when the two-band model of the spectrum includes small corrections from other electron energy bands. In particular, we derive the expressions that describe the dependences of the g factor on e e F -( ) k ex and on the direction of the magnetic field for doped semiconductors. The results are applied to III-V semiconductors and to bismuth.