← All how-to recipes

How to find the label that goes with the highest value

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

Not the biggest number itself, but WHICH item it belongs to — top salesperson, best-selling product, peak day.

The formula

AppFormulaNotes
Excel (desktop)=INDEX(A2:A6,MATCH(MAX(B2:B6),B2:B6,0))MAX finds the biggest number; MATCH locates its row; INDEX returns the matching label. Use MIN for the lowest.
Google Sheets=INDEX(A2:A6,MATCH(MAX(B2:B6),B2:B6,0))Identical; =XLOOKUP(MAX(B2:B6),B2:B6,A2:A6) also works.
LibreOffice Calc=INDEX(A2:A6,MATCH(MAX(B2:B6),B2:B6,0))Identical.

How it works

Three steps working inside-out: MAX(B2:B5) finds the largest number (95), MATCH locates which row that value sits in (row 2 of the range), and INDEX returns the label from column A on that row — "Bob". Swap MAX for MIN to get the label of the smallest value, or use MAXIFS/MINIFS inside for a conditional version. One caveat: if two rows tie for the maximum, MATCH returns the FIRST one; and the modern XLOOKUP(MAX(...),...) form does the same job more readably. This is the standard 'who/what is the top performer' lookup.

Verified, not just documented

We ran =INDEX(A2:A5,MATCH(MAX(B2:B5),B2:B5,0)) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned Bob — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned Bob for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.

Functions used

INDEX · MATCH · MAX — see full Excel, Google Sheets & LibreOffice compatibility for each.

Related recipes

Related comparisons