A 40% margin is not a 40% markup. Enter either one and get the other instantly — plus the price multiplier you apply to cost.
Convert a margin percentage to the equivalent markup and back, with the price multiplier.