The relationship between Margin(M), Margin Percentage (MP), Cost Price (CP) and Selling Price (SP) is as shown below:
M = SP - CP
MP = (M/SP)*100
MP = ((SP-CP)/SP)*100
This therefore allows us to calculate one of the three variables given the other two using one of the applicable equations below:
CP = SP*(100-MP)/100
SP = (100*CP)/(100-MP)
MP = ((SP-CP)/SP)*100