I need some help with the VLOOKUP function. Say, there is a spreadsheet with history of production material supply/consumption.
Each row indicates the date, the type of material, supplied/consumed quantity and total quantity after the supply/consumption. The problem I have is with the total quantity column. I need to add the change in the quantity to the most recent value. At first I tried using VLOOKUP with Type of Material used as a lookup_value. Obviously, this did not work, as there are several values, and the function returned the first one out of them, while I need the last.
Then I tried combining IF, IFNA and VLOOKUP functions. First VLOOKUP checks the row above, and if there is no value (N/A), then the range for VLOOKUP increases. However, there is still a problem with this. The checked ranged is restricted by the amount of times I manually use IF/VLOOKUP combination, but the amount of rows (supply/consumption dates) increases infinitely with time. Is it possible to somehow make VLOOKUP range increase by 1 with each new row?
Or are there any other ways to solve the problem? Perhaps a way for VLOOKUP to return the last value instead of the first?
Thanks a lot in advance!
Bookmarks