Search code examples
excelexcel-formulavlookup

How could I extract data only for end of month dates in Excel?


How could I use a function (VLOOKUP?) to only consider the last transaction for each month (Column C) and record it in Column F

I have tried variations of =VLOOKUP(EDATE(E5, 0),B5:C19, 2), but it results in:

I have a feeling the EDATE function is not correctly identifying the final transaction of each month to feed that date into VLOOKUP. TYIA!


Solution

  • =VLOOKUP(MAXIFS($B$4:$B$18,$B$4:$B$18,"<"&E4),$B$4:$C$18,2,0)