I have created a LibreOffice Calc spreadsheet with columns A-C. In column A, I have a list of parts purchased (in chronologically ascending order). In column B, I have a list of corresponding prices. In column C, I want to show the last purchased price for the current part.
This is what I've come up with to do it:
=INDIRECT(CONCATENATE("B",TEXT(MATCH(A8,A1:A7,1),"#")))
It basically works, but there are two issues:
- It is very convoluted. Is there a simpler way to accomplish this?
- If the part has never been purchased before, it will show the price of whatever part is on the row above.
UPDATE: With more testing, it definitely does not work as expected. I can't tell if it is a bug in the MATCH function or if it is not the appropriate function for the job. The MATCH function finds "smaller or equal", and I think the "smaller" condition is causing problems.