Michaels
Active Member
- Joined
- Apr 2, 2009
- Messages
- 404
Hi all !
I am still stuck with returns on FIFO basis. This is my current sales table:
[TABLE="width: 475"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Sell Date[/TD]
[TD]Product Name[/TD]
[TD]Qty Sold[/TD]
[TD]FIFO COGS[/TD]
[TD]Avg Tranch Out Cost[/TD]
[/TR]
[TR]
[TD="align: right"]09/03/2014[/TD]
[TD]Prod 1[/TD]
[TD="align: right"]94[/TD]
[TD="align: right"]1423.00[/TD]
[TD="align: right"]15.14[/TD]
[/TR]
[TR]
[TD="align: right"]20/03/2014[/TD]
[TD]Prod 1[/TD]
[TD="align: right"]116[/TD]
[TD="align: right"]1799.00[/TD]
[TD="align: right"]15.51[/TD]
[/TR]
[TR]
[TD="align: right"]29/03/2014[/TD]
[TD]Prod 1[/TD]
[TD="align: right"]62[/TD]
[TD="align: right"]1004.00[/TD]
[TD="align: right"]16.19[/TD]
[/TR]
[TR]
[TD="align: right"]29/03/2014[/TD]
[TD]Prod 1[/TD]
[TD]-272[/TD]
[TD="align: right"]-4226.00[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Now I have tried SumProduct, Offset, and round many times, but couldn't come with the right formula. I tried it in Aggregate function but hard luck.
What I am looking for is, if the negative quantity is entered in Cell C4 (current value is -272), the formula in D5 (current value is -4226), it should do reverse sumproduct of Qty Sold and Avg Tranch Out Cost column matching the product.
If we enter -272, D5 should return -4226. How ?
( 62 x 16.19 ) + (116 x 15.51) + (94 x 15.14) = -4226
If we enter -150, it should return:
(62 x 16.19) + (88 x 15.51) = -2369 (rounded) based on product name in column B. So effectively, we are reversing FIFO cost.
I hope I have explained it correctly.
Thank you for your help.
Note: The Avg Tranche Out Cost is a helper column only.
I am still stuck with returns on FIFO basis. This is my current sales table:
[TABLE="width: 475"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Sell Date[/TD]
[TD]Product Name[/TD]
[TD]Qty Sold[/TD]
[TD]FIFO COGS[/TD]
[TD]Avg Tranch Out Cost[/TD]
[/TR]
[TR]
[TD="align: right"]09/03/2014[/TD]
[TD]Prod 1[/TD]
[TD="align: right"]94[/TD]
[TD="align: right"]1423.00[/TD]
[TD="align: right"]15.14[/TD]
[/TR]
[TR]
[TD="align: right"]20/03/2014[/TD]
[TD]Prod 1[/TD]
[TD="align: right"]116[/TD]
[TD="align: right"]1799.00[/TD]
[TD="align: right"]15.51[/TD]
[/TR]
[TR]
[TD="align: right"]29/03/2014[/TD]
[TD]Prod 1[/TD]
[TD="align: right"]62[/TD]
[TD="align: right"]1004.00[/TD]
[TD="align: right"]16.19[/TD]
[/TR]
[TR]
[TD="align: right"]29/03/2014[/TD]
[TD]Prod 1[/TD]
[TD]-272[/TD]
[TD="align: right"]-4226.00[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Now I have tried SumProduct, Offset, and round many times, but couldn't come with the right formula. I tried it in Aggregate function but hard luck.
What I am looking for is, if the negative quantity is entered in Cell C4 (current value is -272), the formula in D5 (current value is -4226), it should do reverse sumproduct of Qty Sold and Avg Tranch Out Cost column matching the product.
If we enter -272, D5 should return -4226. How ?
( 62 x 16.19 ) + (116 x 15.51) + (94 x 15.14) = -4226
If we enter -150, it should return:
(62 x 16.19) + (88 x 15.51) = -2369 (rounded) based on product name in column B. So effectively, we are reversing FIFO cost.
I hope I have explained it correctly.
Thank you for your help.
Note: The Avg Tranche Out Cost is a helper column only.