1

Slight finance question, trying to program the calculation of sell price when we have %margin and cost price.

((CostPrice / ((1 - %Margin) / 100)) * 100) / 100

This is what I am doing at the moment. Can someone confirm it is correct. I am having an issue when we do the calculation the other way round so we go with Cost Price and Sell price to get margin the %margin tends to be different and vice versa. Here is the calculation the other way round:

100 * ((SellPrice - CostPrice) / SellPrice)

Is this just a case of decimal places we pass into calculation or is there a way around this?

Anicho
  • 111
  • Can I suggest you calculate a couple of easy examples by hand and plug them into your formulae to test them. The margin appears to be calculated as a percentage of the selling price, in which case you need to change it to a decimal before using it in your calculation - it should be only the margin divided by 100. But since you have given insufficient detail, I can't comment further, except to say it is redundant to multiply by $100$ then divide by $100$ or vice versa. – Mark Bennet Aug 01 '13 at 14:10
  • So your saying this would be sufficient? (CostPrice / (1 - Margin)) / 100) Makes sense. – Anicho Aug 01 '13 at 14:39
  • @MarkBennet The margin is a percentage value. Apologies for missing this out. – Anicho Aug 01 '13 at 14:48
  • (CostPrice / (%Margin / 100)) – Anicho Aug 01 '13 at 14:51
  • 3
    If $M=100 \times (1-C/S)$ then $S=C/(1-M/100)$ – Mark Bennet Aug 01 '13 at 14:58
  • @MarkBennet Thankyou. – Anicho Aug 01 '13 at 16:55

0 Answers0