This paper generalizes the Stokes formula from the spherical boundary surfa
ce to the ellipsoidal boundary surface. The resulting solution (ellipsoidal
geoidal height), consisting of two parts, i.e. the spherical geoidal heigh
t N-0 evaluated from Stokes's formula and the ellipsoidal correction N-1, m
akes the relative geoidal height error decrease from O(e(2)) to O(e(4)), wh
ich can be neglected for most practical purposes. The ellipsoidal correctio
n N-1 is expressed as a sum of an integral about the spherical geoidal heig
ht N-0 and a simple analytical function of N-0 and the first three geopoten
tial coefficients. The kernel function in the integral has the same degree
of singularity at the origin as the original Stokes function. A brief compa
rison among this and other solutions shows that this solution is more effec
tive than the solutions of Molodensky et al. and Moritz and, when the evalu
ation of the ellipsoidal correction N-1 is done in an area where the spheri
cal geoidal height N-0 has already been evaluated, it is also more effectiv
e than the solution of Martinec and Grafarend.