Hi Michelle.
The margin and the markup actually refer to the same thing  the difference between what you pay for a widget and what you sell it for. The difference is the perspective: the margin is this difference as a percentage of the selling price whereas the markup is this difference as a percentage of the buying price.
Here's an example:
You pay: $50
You sell for: $55
Difference: $5
Margin = $5 / $55 = 9.1%
Markup = $5 / $50 = 10%
If you want a 40% margin, then that means that D/(C+D) = G, where C is the cost ($10), D is the difference and G is the margin in decimal form (0.40). If we solve this equation for D, we see that:
D/(C+D) = G
D = GC + GD
D(1G) = GC
D = GC / (1G)
Now use your figures in this equation: G = 0.40, C = $10. What is D? Knowing D, you just add it to the original cost C to get your selling price.
Hope this helps,
Stephen La Rocque.
