Statistical function

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], ...)
ArgumentWhat it means
number1RequiredA number, cell reference or range.
number2, ...OptionalUp 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

D2fx=MAX(B2:B6)
ABCD
1RepSales
2Ana1840022150
3Ben22150
4Chloe15900
5Dev
6Eva19800

Result: 22150

Dev's empty cell is ignored. The largest number is Ben's 22,150.

2Never pay a negative bonus

D3fx=MAX(0, (B3-C3)*10%)
ABCD
1RepSalesTarget
2Ana1840020000
3Ben2215020000215

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

D2fx=MAX(B2:B4)
ABCD
1OrderDate
2SO-1012026-03-022026-03-18
3SO-1022026-03-18
4SO-1032026-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

D2fx=AGGREGATE(4, 6, B2:B4)
ABCD
1StoreMargin
2North0.210.27
3South#N/A
4East0.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).

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 17 KB

Common errors and how to fix them

ErrorWhy it happensFix
#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 unexpectedlyThe 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.

LanguageFunction name
DanishMAKS
FinnishMAKS
Norwegian (Bokmål)STØRST
Portuguese (Brazil)MÁXIMO
Portuguese (Portugal)MÁXIMO
RussianМАКС
TurkishMAK

Recipes that use MAX