There is no formula for that. You must consult the industrial standards for the particular type of application (static or dynamic, boss or face seal, pressure or vacuum, backup ring or not, dovetail or not, seal material, type of fluid or gas, pressure range, etc.). The Parker O-ring handbook is a good place to start. Also, O-ring manufacturers will have that information.