The formula used for this is: weight/(1.0278-(.0278*reps))
If you know your One Rep Max, and you want to do a set that calls for a set number of reps, multiply your reps by that coefficient to determine the proper weight for the reps (I know it's confusing, the examples at the bottom will clear it up).
If you know your "x" rep max, and you want to find out what your 1 rep max should be for that exercise, devide the coefficent by the corresponding "rep #".
A routine for squats calls for you to do 3 sets of 8 reps. You want to know what a good hard set of 8 reps would be, and you know your current 1 rep max on the squat is 385 lbs. 385 x .786 = 303. You should be able to do an 8 rep set at 303 +/- 5 lbs. or so.
You are working a periodization routine, and you need to find percentages of your 1 rep max to set up your weekly routines. You don't have a spotter available to help you find a 1 rep max on your bench press, but you do know you can squeeze out (barely) 5 good reps at 230 lbs. 230 divided by .856 = 268. Your 1 rep max should be about 268 lbs. +/- 5 lbs. or so.
This chart should not be taken as an absolute, and remember if you have been doing high rep sets for the past 3 months, you are not going to be able to handle the 1 rep max that the math says you should, due to lack of tendon strength and raw power neccesary to lift low rep weights. Alternately, if you have been working 2-3 rep sets for a while, higher reps sets will take a while to get used to.
There's also an online one rep max calculator at the CyberIron Bodybuilding and Weightsnet
Here's a chart you can use to estimate your one rep max for specific lifts.
Here's another formula for calculating one rep max. Take the number of reps * .033. Then add 1 to that number. Take that number and multiply the weight you used for the number of reps. Your one rep max should be within 5 pounds on either side. For example, if you do 155 for 8 reps, 8 * .033 = .264, 1 + .264 = 1.264, 1.264 * 155 = 195.92. So your one rep max in this example should be 195. It could be anywhere from 190 to 200.
Yet another method for calculating one rep max. This came out of a powerlifting book which states that trying to calculate a proper one rep max using more than 10 reps will be ineffective due to physiological differences between so many reps. This source uses one set of coeffecients for squats and deadlifts, and another set for benchpresses. Here they are: