# Board index » delphi » Computing profit

## Computing profit

Howd'y

I can do find the selling price after i add the tax rate and profit margin

What i want to do is the reverse.

I want to set the selling price and then find profit margin %

Does any kind soul out there remember how to do this? I've gon blank

thanks

## Re:Computing profit

The message <624etu\$...@duke.telepac.pt>
from  "Alberto Nunes" <ja...@mail.telepac.pt> contains these words:

Hi
I assume you want to get rid of the sales tax first.
PreTaxSalePrice = (sellingPrice-((sellingPrice/(tax% +100))*100)

Then if you want your profit margin on your selling price ( profit on
return)  is ((PreTaxSalePrice - costPrice)/PreTaxSalePrice)*100)

Profit margin on your buying price (Profit on cost) divide by the
cost price instead of the PreTaxSalePrice,

The advantage of using 'profit on return' is that in your end of
period accounts you can see if the profit margin is similar. So no
stock stolen,
short deliveries or cut prices etc.

Just a note, I go back to before 4 function calcs! my way of finding
an on- cost% from an on-returns% or the other way round is as follows :-

Turn it into a fraction with 1 on the top, 7%  1/(100/7) = 1/14.2857
to go from 'return' to 'cost' subtract 1 from the bottom
line(1/13.2857)  and work out the %. To go from 'cost' to 'return'
add 1 to the bottom line. This useful for sales Tax etc.

Henry

##### Quote
>  Howd'y
> I can do find the selling price after i add the tax rate and profit margin
> What i want to do is the reverse.
> I want to set the selling price and then find profit margin %
> Does any kind soul out there remember how to do this? I've gon blank
> thanks

## Re:Computing profit

##### Quote
Alberto Nunes wrote:

>  Howd'y

> I can do find the selling price after i add the tax rate and profit
> margin

> What i want to do is the reverse.

> I want to set the selling price and then find profit margin %

> Does any kind soul out there remember how to do this? I've gon blank

> thanks

This is relatively simple.

ProfitMargin := (SellingPrice / (1 + TaxRatePct)) - ItemCost;

Of course, this is a rather simplistic example where we assume that
there is only a fixed set of costs that go into ItemCost.  For a
situation where variable costs apply to the total ItemCost, you'd just
calculate those values for each use.

Thus if:  SellingPrice = \$100
ItemCost     = \$65
TaxRatePct   = 11.1%

Then:
1+TaxRatePct = 1.111
(SellingPrice / (1 + TaxRatePct)) = \$90 (Approximately)

and       ProfitMargin = (\$90 - ItemCost) = \$25

HTH

Derek