I'm curious as to how you calculated the distance between the Moon and Earth. That distance might not be the semi-major axis of the Moon's orbit. It might be the sum of the Moon's semi-major axis and the Earth's semi-major axis, as measured from their combined center of mass. (The 'a' in the previous equation is actually the sum of the semi-major axes, or the distance you most likely calculated.)
In practice, calculating the mass and the semi-major axis of planets was an almost impossible task even after Newton turned Kepler's Third Law into a formula. You had a formula containing three unknown variables (the universal gravitational constant, the mass, and the semi-major axis) and the only known was the orbital period.
In fact, that's why the Earth's semi-major axis for it's orbit around the Sun was measured in astronomical units, with one AU being the distance between the Sun and the Earth. You could measure Jupiter's semi-major axis in AU's, but had no way to convert that into a more traditional measure such as kilometers.