I need help with returning a product price based on its invoice date.
F.e. I have a product that has been sold on 2023-11-27 for 50 Eur. There are two different pricelists: EUR and USD. Since it has been sold for EUR, I need it to return the price list price from EUR sheet. In the EUR sheet, this product has prices ranging from 2020-01-01 to even 2024-01-01, so for example the latest price is For 2023-12-01 for 52 Eur, but the other older one was entered in 2022-01-01 and it was 49 Eur. So since the sale happened in 2023-11-27 (before 2023-12-01 price change), I need it to return the price that was available in the price list from 2022-01-01 - 49 Eur (also would be awesome if the date could be returned aswell).
I have the document attached and I did try using VLOOKUP by joining the products and dates, unfortunately I am not getting the result. I'd be really grateful!
J column has this formula at the moment:
=IF(I2="EUR";VLOOKUP(E2&VLOOKUP(D2;EUR!G:G;1;TRUE);EUR!A:J;7;0);VLOOKUP(E2&VLOOKUP(D2;USD!G:G;1;TRUE);USD!A:J;7;0))
The products I print screened don't matter here at the moment (it's a huge list)