How to calculate the repulsion force between two electromagnets
For a straight forward solenoid you have this for the attractive force: -

Force = \$\dfrac{(amps\cdot turns)^2\cdot \mu_0\cdot A}{2\cdot g^2}\$ newtons

Where 


A is cross sectional area of the solenoid (metres squared)
g is gap between end of solenoid and "thing" to be attracted (metres)
\$\mu_0\$ is 4\$\pi\$ x \$10^{-7}\$


Where the "thing" is in fact another solenoid, identical to the first and generating the same pole the force of repulsion will be doubled.

Here is a calculator for the above formula that saves a bit of work.