Measure the diameter of the wire forming the spring. For most non-industrial uses it usually is about a ½ inch outside diameter or less. Take a click pen apart and take the spring off the ink tube and measure it or measure the coils on your mountain bike. In both instances -- in fact all instances -- the formula to determine the spring rate remains the same. Only the numbers and shock spring rate change.
Determine the coil diameter. You can do this by measuring or arithmetically. The coil diameter is the measurement from the center of one coil to the center of the opposing coil. If you know the outside diameter and the wire diameter, the formula to determine the coil diameter would be: Coil Diameter equals Outside Diameter of the coil minus the wire diameter. That will tell you the center-to center of the center measurement of the coil or the coil diameter. You can always measure to make sure.
Count the number of coils in the spring, excluding the top and bottom coils. Those aren't compression coils. They are considered seating or base coils. It's the coils in between that are compressed by dynamic (shock) or dead weight.
Enter the appropriate figures into the Shock Spring Rate Calculator included in the references below and press the calculate button. It will provide you with the shock spring rate. Basically, the number is telling you the number of pounds per inch of spring the spring can withstand before it no longer has any further ability to compress. It is, for all intents and purposes, squished flat or, if not flat, it just has no more "give" to it. There is no more springiness to the spring.