MAX function
Returns the largest number in a set of values, such as the highest sale, the top score or the latest date.
Available in All versions of Excel, including Microsoft 365 and Excel for the web
In every Excel versionWorks in Google Sheets
Syntax
MAX(number1, [number2], ...)| Argument | What it means | |
|---|---|---|
number1 | Required | A number, cell reference or range. |
number2, ... | Optional | Up to 255 numbers, references or ranges in total. |
Returns: The largest numeric value, or 0 if there are no numbers.
How MAX works
MAX looks through the numbers you give it and returns the biggest one. It is one of the most used functions in Excel: the best month's revenue, the highest exam mark, the largest invoice, the most recent order date (dates are numbers in Excel, so the latest date is the largest). You can mix ranges and single values, e.g. =MAX(B2:B20, D2:D20, 1000).
In ranges MAX quietly skips empty cells, text and TRUE/FALSE. If there are no numbers at all it returns 0, not an error, which can be misleading. Error values such as #N/A inside the range make MAX return that error; use AGGREGATE with option 6 to ignore them. If you need the largest value that meets a condition, use MAXIFS; for the second or third largest, LARGE.
Examples
1Highest sale
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Rep | Sales | ||
| 2 | Ana | 18400 | 22150 | |
| 3 | Ben | 22150 | ||
| 4 | Chloe | 15900 | ||
| 5 | Dev | |||
| 6 | Eva | 19800 |
Result: 22150
Dev's empty cell is ignored. The largest number is Ben's 22,150.
2Never pay a negative bonus
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Rep | Sales | Target | |
| 2 | Ana | 18400 | 20000 | |
| 3 | Ben | 22150 | 20000 | 215 |
Result: 215
Ben beat his target by 2,150, so his bonus is 215. Copied to Ana's row, (B2-C2)*10% is -160 and MAX(0, …) turns it into 0. Using MAX against 0 is a classic way to set a floor.
3Most recent order date
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Order | Date | ||
| 2 | SO-101 | 2026-03-02 | 2026-03-18 | |
| 3 | SO-102 | 2026-03-18 | ||
| 4 | SO-103 | 2026-03-09 |
Result: 2026-03-18
Dates are stored as serial numbers, so MAX returns the latest one. Format D2 as a date to see 2026-03-18; in General format you would see the serial number 46099.
4Ignore errors with AGGREGATE
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Store | Margin | ||
| 2 | North | 0.21 | 0.27 | |
| 3 | South | #N/A | ||
| 4 | East | 0.27 |
Result: 0.27
=MAX(B2:B4) would return #N/A. AGGREGATE with function 4 (MAX) and option 6 (ignore errors) returns 0.27 (27% if the cell is formatted as a percentage).
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A (or another error) | A cell in the range contains an error. | Fix the source, or use =AGGREGATE(4,6,range) / =MAXIFS(range,range,"<>#N/A"). |
Result is 0 unexpectedly | The range contains no real numbers, often because the numbers are stored as text. | Convert text numbers (Data > Text to Columns or -- / VALUE). |
Tips
=MIN(MAX(x, low), high)clamps a value between a lower and upper limit.- Typed text numbers and TRUE inside the argument list are counted (
=MAX("7", 3)returns 7), but the same values in cells are ignored. - To find who has the maximum:
=XLOOKUP(MAX(B2:B6), B2:B6, A2:A6).
Questions
Why does MAX return 0?
There are no numeric cells in the range. Numbers formatted as text are the usual cause; convert them to real numbers.
How do I find the maximum with a condition?
Use =MAXIFS(values, criteria_range, criteria) in Excel 2019 or later, or =MAX(IF(...)) as an array formula in older versions.
Does MAX work with times and dates?
Yes. Dates and times are numbers in Excel, so MAX returns the latest date or longest time; just format the result cell.
Google Sheets
MAX also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
MAX in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Danish | MAKS |
| Finnish | MAKS |
| Norwegian (Bokmål) | STØRST |
| Portuguese (Brazil) | MÁXIMO |
| Portuguese (Portugal) | MÁXIMO |
| Russian | МАКС |
| Turkish | MAK |