If the formula to calculate the force of gravity between two objects is:
$$F = GM_1M_2/r^2,$$
why do planets stay in orbit? Or is there another formula at work?
When an object is in orbit, there are two factors at play, not just one. The first, as you mention, is the force of gravity pulling the objects together. However, each object also has a momentum component which is generally (in the case of circular orbits) perpendicular to the direction of the gravity.
If we look at the common situation of a small-mass object orbiting a large (massive) object, then we can ignore the perpendicular velocity (momentum) component of the larger object and reach a simplification: The smaller object is continually pulled towards the primary but perpetually 'misses' due to its own perpendicular momentum.
There are other formulas at work, but not any other forces.
You need to take into account ont only the force, thus the acceleration, but also the current velocity of a body orbiting another.
To put it simply: if you move a ball sticked to a rope around your head, the only forces are the tension of the rope and gravity towards the floor. Ignoring gravity, the only force is the tension of the rope, but it anyway does not make the ball to orbit your head, it in fact makes the ball to orbit it, due to the speed you put on it.
The gravity for an orbit, like the rope, causes the already moving object to curve its otherwise stright trajectory into an ellipse/circumference, not to fall to center.
Well, Kepler has explained that 2 randomly moving objects, attracted towards each other, will always form elliptical orbits. The Aphelion and Perihelion depend on that initial motion, position, force of attraction. The only case when 2 objects collide is when the perihelion is closer to the orbit edge than the sum of the radii of the 2 objects.
This very good question (I wondered myself the same 30 years ago! :-) has an important yet simple answer: because of inertia, in most cases they miss collision. In short, e.g. planets's trajectories are a compromise between their tendency to move on straight lines (inertia) and the gravitational pull applied by other objets. When the gravitational pull becomes stronger, velocity increases hence inertia increases, which typically allows the planet to zip next to the source of pull (it has gained so much velocity by then that it just overshoots). So, in practice, only a tiny set of initial conditions lead to actual collision. Those which hit have zero angular momentum to start with (so they are on a purely radial collisional orbit).