The formula for gravitational force between two objects is , where m and M are the masses of the objects and r is the distance between them. Rearrange the formula to solve for M.