← All how-to recipes

How to find the position of the maximum value

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

Which row (or item number) holds the largest value — the rank position of the peak.

The formula

AppFormulaNotes
Excel (desktop)=MATCH(MAX(A2:A6),A2:A6,0)MAX finds the value; MATCH returns its position in the range (1-based). Use MIN for the smallest.
Google Sheets=MATCH(MAX(A2:A6),A2:A6,0)Identical.
LibreOffice Calc=MATCH(MAX(A2:A6),A2:A6,0)Identical.

How it works

MAX(A2:A5) finds the biggest value (95) and MATCH returns its position within the range — 2, because 95 is the second item. This is the position WITHIN the range, not the sheet row; add the range's starting row minus one if you need the absolute row number. Feed the position into INDEX to pull a corresponding label (see find-the-value-corresponding-to-the-max). If several cells tie for the maximum, MATCH returns the first one's position. Swap MAX for MIN, or MAXIFS/MINIFS, for the smallest or a conditional peak.

Verified, not just documented

We ran =MATCH(MAX(A2:A5),A2:A5,0) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 2 — 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 2 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

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

Related recipes

Related comparisons