Hello Everyone,
I believe I found a formula that needs to be corrected to help properly calculate FIFO to account for partial sales of quantity.
I have done some research on how to calculate FIFO, and I found a template that shows an example of calculating FIFO inventory value. I have attached it for reference.
In the calculator attachment, you simply put in a number of units sold in C4, say a value of 600, and you see how it updates cells in column F and the "Totals" row with proper values. I am looking to mimic these in my spreadsheet example.
Attached is an example I have had lots of help with by the great people of this forum. If you look at column J (Outbound Quantity), the formula is very close to what we see in the calculator.
Calculator: =MIN(C7,$C$4-SUM($F$6:F6))
My Spreadsheet: =MIN(F6,-SUM($J$5:J5)-$F$36)
The changes to my formuala I would like to make include removing the '-$F$36' to no longer make it depended upon a lifetime total of inbound and outbound quantity.
And also to use a sort of lookup command to insert after the '(F6,' that will search through column B, find the very next "Sale" text string, and use the value for quantity found 5 columns over to the right.
This is what I am thinking so far: =MIN(F6,LOOKUP_COMMAND_HERE-SUM($J$5:J5))
where LOOKUP_COMMAND_HERE = some sort of VLOOKUP command maybe.
I've tried this, but it can't precisely find only the next "Sale" in the sheet, while ignoring all the ones after it:
=VLOOKUP($B$6:B999="Sell",B6:F33,5,FALSE)
Can somebody help to get this to where it searches B and targets the next "Sale" only, then after that line's calculation, starts over from the next purchase line, to search and lookup the next "Sale" after the previous one, pulling the known value for Quantity (column F) and so on?
And have that looked up value be inserted into the MIN formula to be used to calculate column J (equal to "Units Sold" in the calculator spreadsheet)? I understand this will ruin the calculations for columns K, L, M, N, O, P, and Q. We'll cross that bridge if we can get there.
I'm not sure yet, but if we can get this working, will columns K and N be needed anymore?
Bookmarks