FormulaCraft

How to find the first matching value in a row in Excel and Google Sheets

Topic:Lookups (any direction)
Excel & Google Sheets
=INDEX($B$1:$E$1,MATCH(TRUE,$B$2:$E$2>50,0))

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Identify the row to search (e.g. B2:E2) and the criteria (e.g. value > 50).
  2. 2Use MATCH with the logical array: MATCH(TRUE,B2:E2>50,0) — in Excel confirm with Ctrl+Shift+Enter; Google Sheets handles it automatically.
  3. 3Wrap in INDEX against the header row to return the column name: =INDEX($B$1:$E$1,MATCH(TRUE,$B$2:$E$2>50,0)). This returns the header of the first column exceeding 50.

Tips

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.

Frequently asked

How do I find the first matching value in a row using HLOOKUP?

HLOOKUP searches the first row for a value and returns from a specified row below it: =HLOOKUP(lookupValue,B1:E5,2,FALSE) finds the value in row 1 and returns the cell in row 2 of that column.

More on Lookups (any direction)

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: