The ground state of the two-electron donor-impurity complexes and confined in a quantum well is analysed by using a variational procedure. A model approximation that can be used in the two-electron problem in order to separate the variables is proposed, and it is shown that, for the negative ion and the complex, the electron-electron interaction may be eliminated, in this approximation, by introducing an additional effective charge at a centre of symmetry. The binding energy is calculated as a function of the quantum-well width for different magnetic field strength values, whereas the and dissociation energies are calculated as functions of the spacing between the impurities in the complexes, and for different well widths. The results for the first and the second ionization binding energies as functions of the well width are presented for different separations between impurities. Finally, the scheme that we propose is extremely simple and provides a realistic description of few-particle ground-state electronic structures confined in a quantum well.