A scheme for the numerical calculation of Zeeman splitting factors for erbium ions in a crystalline environment is described. The examples of crystal fields of trigonal or tetragonal symmetry are presented in some detail. From the results it is concluded that the trace of the g tensors can be remarkably constant upon distortion from an initially cubic symmetry to a lower axial symmetry.