We present a general method for calculating the energy spectrum of donors confined in heterostructures with axial symmetry in the presence of magnetic and electric fields applied along the symmetry axis. The donor’s wave functions are chosen as a product of the Slater orbitals and an envelope function that is a solution of a one-dimensional differential equation, which we derive starting from Schrödinger’s variational principle. We calculate the energies of the ground and some excited states of a donor confined in multiple quantum wells and a nanowire superlattice as functions of the donor position, electric and magnetic fields for structures with different numbers and widths of the wells and the barriers. Our method could be applicable to a variety of complex quantum-confined semiconductor structures for which more rigorous approaches require extensive numerical calculations.