# Inverse weighted average cost

I have calculated a weighted average cost for a new goods of a specific product as following:

inQuantity [received quantity of that product] = 100

inCost [the cost of received goods of that product] = 10

currentQuantity [the quantity in stock of that product] = 50

currentCost [current cost for that product] = 5

totalQuantity [received quantity + current quantity in stock] = in quantity + current quantity

weightedAverage = $$\frac {\text ({inQuantity} \times \text{ inCost}) + \text ({currentQuantity}\times \text { currentCost})} {\text {totalQuantity}}$$

So; the new currentCost will be = 8.3 while I don't have a reference for the old currentCost which was (5).

Now I want to return those goods back, and I want to reverse this calculation, so; the currentCost should return back to (Whatever it was before calculation [ex: 5]).

• Note: I reformatted your definition of the weighted average...please check to make sure I didn't introduce any errors. – lulu Sep 15 '18 at 16:49
• Note 2: I don't understand your question. Nothing you wrote appears to depend on a variable called "original cost". What variables am I allowed to change? What result am I after? – lulu Sep 15 '18 at 16:50
• Using "OriginalCost" and "CurrentCost" to mean the same thing is confusing. But, still. What is the question? Obviously If I know every term in your formula except for one, I can calculate the missing one. Is that all you are asking? – lulu Sep 15 '18 at 16:58
• Do you mean $8.3$ for the newCost? Where did $3.8$ come from? Does the formula I wrote in my prior comment settle the matter? If no, why not? The only problem here is the lack of clarity. The formula is very simple...if you just state what values you know and which you seek, it should be easy to solve. – lulu Sep 15 '18 at 17:07
• $$\frac {(8.\overline 3\times 150)-(100\times 10)}{50}=\frac {1250-1000}{50}=5$$ – lulu Sep 15 '18 at 17:33