Search code examples
google-sheets

This is returning the first instance rather than the last in google sheets


What I am trying to do in Google sheets is search column D for the last cell that has "English"... Then return that row from E thru BL.

For some reason, this formula is returning the first matching row and not the last:

=INDEX(E2:BL, MATCH("English", D2:D, MATCH(2, 1/(D2:D="English"))))

How would I adjust?


Solution

  • Use XLOOKUP with search_mode set to -1:

    =XLOOKUP("English",D2:D,E2:BL,,,-1)