hi,
it is kind of a statistics/maths question but of course programming is all mathematics :)
In my application the initial cost of a product "was" known and the a percentage of the profit was added to find the selling price. at the end of the month the total sales amount is known. Now at this stage, I have to generate profit report and have to show total profit earned. e.g
product A cost = 100
% or profit = 70%
sale price = 170
sold qty = 200
total sales = 34000
now for this simple example I know that profit earned is 14000. but how can I apply some formula on 34000 to get this 14000 of total profit?
because in actual application values are very high and the total sales is a sum of sales of hundreds of different products. to rephrase in simple words, I have total sale amount (34000 in example) and I know that sale price was found by profit percentage of (70% as in example) now how can i find the total profit from 34000? if I do simple 34000 x 70%, I get wrong answer. COST at this point is not known to me. sale prices were calculated by other people on some stage I am just given with database of sales amounts and profit percentage.
thank you