Google Sheets function · Statistical
MAX in Google Sheets: syntax and examples
MAX scans numbers and returns the largest. It accepts several ranges and plain values at once. Text inside a range is skipped, so a column with notes does not break it.
Syntax
MAX(value1, [value2, ...])
Arguments
| Argument | Type | Required | What it does |
|---|---|---|---|
value1 | any | yes | The first number or range. |
value2, ... | any | no | More numbers or ranges. |
Examples
The examples use this table, starting in A1:
| Product | Price | Stock |
| Lamp | 79.9 | 12 |
| Chair | 549 | 0 |
| Stand | 129.5 | 7 |
| Tray | 34 | 40 |
=MAX(B2:B5)Result: 549
The highest price in the column.
Run in a Google Sheet (English US locale) on .
=MAX(B2:C5)Result: 549
A two-column block: the largest number anywhere in it.
Run in a Google Sheet (English US locale) on .
=MAX(B2:B5, 600)Result: 600
Mix a range and a fixed number. Useful as a floor or a cap.
Run in a Google Sheet (English US locale) on .
=INDEX(A2:A5, MATCH(MAX(B2:B5), B2:B5, 0))Result: Chair
MAX gives the value; MATCH and INDEX give the product that owns it.
Run in a Google Sheet (English US locale) on .
=MAX(A2:A5)Result: 0
A range with only text returns 0, not an error.
Run in a Google Sheet (English US locale) on .
Common errors
- A range with no numbers returns 0, not an error. A 0 can therefore mean "no data".
- Text typed directly as an argument, as in MAX("abc"), returns #VALUE!. Text inside a range is ignored.
- MAX returns the value, not its position. Use MATCH with INDEX to get the matching row.
Compared with Excel
Same syntax in Excel.