Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
=LOOKUP(2,1/(A2:A6=D2),B2:B6)Edit the grid or formula, then run it through a real spreadsheet engine — no signup.
Sample data — click any cell to edit
Need it for your exact data?
Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.
LOOKUP finds the largest value less than or equal to the lookup value. Since the array only contains 1s (and errors), LOOKUP returns the position of the last 1, which is the last match.
Yes — the 1/(range=value) trick works on unsorted data because LOOKUP is searching a computed array, not the raw data.
Look up a value in the top row of a table and return a value from a row below it — the horizontal cousin of VLOOKUP.
How-toUse VLOOKUP or MATCH with wildcard characters (* and ?) to perform partial-match lookups on text values.
How-toUse INDEX with MATCH and the EXACT function to perform a lookup that distinguishes between uppercase and lowercase text.
How-toUse SUMIF or SUMIFS to sum all values that match a lookup criterion, returning the total of all matching rows rather than a single result.
How-toUse INDEX and MATCH with ABS and MIN to find the value in a list that is numerically closest to a target number.
How-toUse MATCH with a combined range or INDEX to search for a value across several columns and return the column it was found in or its adjacent value.
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: