Enter cost and price, or cost and the margin you want.
Margin is relative to the selling price, markup to the cost. An item costing 75 sold for 100 has a 25% margin and a 33.3% markup. Confusing them is one of the commonest pricing mistakes.
Only if the cost is zero, so the tool refuses a target margin of 100% or more.
By moving average: each receipt updates the average and each sale leaves at it, so reported margins rest on actual cost.