The gravity formula that most people remember, or think of, is the equation which captures Newton’s law of universal gravitation, which says that the gravitational force between two objects is proportional to the mass of each, and inversely proportional to the distance between them. It is usually written like this (G is the gravitational constant):
F = Gm1m2/r2
Another, common, gravity formula is the one you learned in school: the acceleration due to the gravity of the Earth, on a test mass. This is, by convention, written as g, and is easily derived from the gravity formula above (M is the mass of the Earth, and r its radius):
g = GM/r2
In 1915, Einstein published his general theory of relativity, which not only solved a many-decades-long mystery concerning the observed motion of the planet Mercury (the mystery of why Uranus’ orbit did not match that predicted from applying Newton’s law was solved by the discovery of Neptune, but no hypothetical planet could explain why Mercury’s orbit didn’t), but also made a prediction that was tested just a few years’ later (deflection of light near the Sun). Einstein’s theory contains many gravity formulae, most of which are difficult to write down using only simple HTML scripts (so I’m not going to try).
The Earth is not a perfect sphere – the distance from surface to center is smaller at the poles than the equator, for example – and it is rotating (which means that the force on an object includes the centripetal acceleration due to this rotation). For people who need accurate formulae for gravity, both on the Earth’s surface and above it, there is a set of international gravity formulae which define what is called theoretical gravity, or normal gravity, g0. This corrects for the variation in g due to latitude (and so both the force due to the Earth’s rotation, and its non-spherical shape).
Here are some links that you can follow to learn more about gravity formulae (or gravity formulas): Newton’s theory of “Universal Gravitation” (NASA), International Gravity Formula(e) (University of Oklahoma), and Newton’s Law of Gravity (University of Oregon).
Many aspects of gravity, including a gravity formula or three, are covered in various Universe Today articles. For example, New Research Confirms Einstein, Milky Way Dwarf Galaxies Thwart Newtonian Gravity?, and Modifying Gravity to Account for Dark Matter. Here’s some information on 0 gravity.
Astronomy Cast’s episode Gravity gives you much more on not just one gravity formula, but several; and Gravitational Waves is good too. Be sure to check them out!