fxExcelReps
← All functions Σ Math & statistics · Beginner

MAX The largest number in a range.

How to use MAX in Excel

MAX returns the largest number — the top sale, the highest score or the latest date.

Syntax

=MAX(number1, [number2], ...)

number1A number, cell or range.
[number2], …Optional additional values.

Examples

=MAX(D2:D50)Best monthly sales figure.
=MAX(B2:B100)Latest date in a list.
=MAX(0, B2-C2)Profit, but never below zero.

The largest value with a condition

MAXIFS finds the largest value among the rows that match, like the biggest loan in one branch.

=MAXIFS(D2:D500, B2:B500, "North")The largest amount in the North region.
=MAXIFS(A2:A500, C2:C500, "Paid")The date of the latest paid invoice (dates are numbers too).

Who has the largest value?

MAX returns the value, not the row. Combine it with XLOOKUP or INDEX/MATCH to get the name next to it.

=XLOOKUP(MAX(D2:D500), D2:D500, A2:A500)The client with the largest balance.
=INDEX(A2:A500, MATCH(MAX(D2:D500), D2:D500, 0))The same in every Excel version.

MAX as a floor

MAX of a value and 0 never goes below zero. It's the cleanest way to stop negative results.

=MAX(0, TODAY()-B2)Days overdue, or 0 if the invoice isn't due yet.
=MAX(0, C2-D2)The amount still to pay, never negative.

Common mistakes

Returns 0
The range has no numbers, or all values are negative and a 0 is hidden somewhere.
Want the 2nd or 3rd biggest?
MAX only gives the first. Use LARGE(range, 2).

Tips

  • Combine with INDEX/MATCH to find who has the max: =INDEX(A2:A10, MATCH(MAX(B2:B10), B2:B10, 0)).

Frequently asked questions

Why does MAX return 0?

There are no numbers in the range, or they're stored as text. MAX ignores text, so "1 250" with a space doesn't count.

How do I find the second largest value?

Use LARGE: =LARGE(D2:D500, 2). LARGE with 1 is the same as MAX.

How do I find the latest date in a list?

Dates are numbers, so =MAX(A2:A500) gives the latest one. Format the result cell as a date.

What's the difference between MAX and MAXA?

MAXA also counts text as 0 and TRUE as 1. In practice MAX is almost always what you want.

Available in: All versions of Excel, Excel for the web, Google Sheets

Related functions

MINLARGEAVERAGEINDEX

↑ Practise MAX in the sheet above