A simple method for constructing effective Hamiltonians for the 4f(N) and 4f(N - 1)5d energy levels of lanthanide ions in crystals from quantum-chemical calculations is presented. The method is demonstrated by deriving crystal-field and spin-orbit parameters for Ce(3 + ) ions doped in LiYF(4), Cs(2)NaYCl(6), CaF(2), KY(3)F(10) and YAG host crystals from quantum-chemical calculations based on the DV-Xα method. Good agreement between calculated and fitted values of the crystal-field parameters is obtained. The method can be used to calculate parameters even for low-symmetry sites where there are more parameters than energy levels.