The 'formula' you need basically relates to what we call Partial Pressure. In terms of human survive-ability, this is the primary 'measure' you need to consider when planning your atmosphere.
The O2 at sea level represents about 0.21 bar of pressure (being 1 bar pressure, O2 being 21% of that mix). The minimum that humans can safely handle is around 0.16 bar, and any higher than 0.30 bar over sustained periods is going to cause issues to human biology.
SO - If your planet has a LOW pressure atmosphere, then a pure O2 atmosphere is fine. This is why the Apollo missions could safely occur in a pure oxygen environment; the cabins of the spacecraft were not pressurised to sea level. They pressurised them to around 0.3 ATM (0.3 bar) so that the pressure differential between the inside of the ship and the vacuum of space was not so great, meaning that they didn't need to be as strong (read as heavy).
Of course, your natural atmosphere isn't going to be pure O2, and if it is, you don't want to live there anyway because it means there's nothing consuming O2, which probably means there's nothing there to produce it either. Definitely a 'bring your own plants' scenario.
As the pressure increases, so too must your inert (or at least poorly reactive) gasses. On Earth, that's nitrogen. It's not inert, but at sea level pressures it doesn't react with our systems. As you increase the pressure however, nitrogen becomes a narcotic at high partial pressures (divers know all about this) meaning that you can't use it to dilute O2 if your pressure is much higher than Earth's.
Deep see divers mix other inert gases into their breathing mix to cater for this when going deep where the air they breathe is under considerable pressure.
That only leaves toxic gases. Carbon Dioxide, Chlorine, and others can't exist in any more than trace amounts for humans to function normally. Better to exclude them as much as possible.
So with all that said, your formula (based on atmospheric pressure) looks like this...
0.16 to 0.3 bar Oxygen (Necessary)
0.30 to 0.8 bar Nitrogen (Optional)
Inert gases to taste (up to a threshold pressure that makes it hard for humans to function, whatever that may be)
Trace amounts of CO2, Chlorine etc. (Maximums, preferably absent)
Working on this formula, you can basically mix and match an ideal atmosphere by first deciding on your atmospheric pressure, adding in your O2 and then adding in other gases according to the proportions above to suit your taste until your pressure is reached.