One way would be to have, for example, your cost price in B4, Selling Price in C4. The margin, in D4 will be =C4-B4. The percentage margin, in E4, will then be either =D4/C4 or =D4/B4, depending on whether you want to calculate it on the cost price or sale price. Format B, C, & D as currency, E4 as percentage.
HTH