FormulaCraft

How to find the closest matching value in Excel and Google Sheets

Topic:Lookups (any direction)
Excel & Google Sheets
=INDEX(B2:B5,MATCH(MIN(ABS(B2:B5-D2)),ABS(B2:B5-D2),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. 1Put your target value in a cell (e.g. D2).
  2. 2Enter =INDEX(B2:B5,MATCH(MIN(ABS(B2:B5-D2)),ABS(B2:B5-D2),0)) in the result cell.
  3. 3In Excel (non-365), confirm with Ctrl+Shift+Enter. In Google Sheets and Excel 365, press Enter.
  4. 4ABS(B2:B5-D2) calculates the absolute difference for each value; MIN finds the smallest difference; MATCH locates its position; INDEX returns the original value.

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

What if the target exactly matches a value in the list?

The formula works correctly — ABS gives 0 for an exact match, which is the minimum, so the exact match is returned.

Can I find the closest value above or below the target?

Yes — filter the differences to only positive (above) or only negative (below) before finding the MIN.

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: