The equation for the force exerted by a spring is as follows:
F = -kx, with k = spring constant, and x = displacement of the spring.
Provided you are given the force exerted by the spring, and the displacement, you can solve for the spring constant with relatively simple algebra.