← All how-to recipes

How to find the label that goes with the highest value

✓ Verified in LibreOffice 25.8.7.3

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

The formula

AppFormulaNotes
Excel=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. Every formula here is confirmed by actually executing it.