There seems to be a consensus that 180 steps per minute is a physiologically optimal running cadence. I don't understand how that can be universally true: Isn't the leg/arm system in running essentially a pendulum? If so then the natural cadence should decrease as height and leg-length increases. E.g., if you found someone with a "perfect" running stride and then increased their height by 25%, that cadence would naturally decrease by Sqrt(1/1.25).
Short answer, 180 is an example cadence, not the optimum, although it's a typical minimum number for competitive runners and a good starting point.
Your height, weight, leg and stride length and running ability will determine your optimal cadence. Everyday runners generally fall between 160-170 steps per minute, while elite runners strike the ground around 180 steps per minute or higher—with some getting above 200 at their fastest speeds.
Unfortunately, there really isn't a formula, so it's basically a matter of determining your cadence, and then trying to change it and seeing if it works for you.