Skip to content

MAX

Returns the largest number in the values you give it. Text and blanks are ignored, and with no numbers it returns 0.

Syntax

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

Statistical

All versions of Excel, including Excel for Microsoft 365 and Excel for the web.

Try it

Edit the formula in B10 or change the inputs. The sheet recalculates as you type.

B10
A
B
C
1
Day
Peak temp (C)
2
Mon
21
3
Tue
24
4
Wed
19
5
Thu
27
6
Fri
25
7
Sat
22
8
Sun
26
9
10
Hottest day
27

B10 =MAX(B2:B8) returns 27

How MAX works

MAX returns the biggest number it finds. Use it for the highest sale, the latest date, the peak load, or as a "no less than" floor inside a calculation.

What MAX looks at

In a range or cell reference MAX considers only numbers, and dates count as numbers. It ignores:

  • text, including numbers stored as text;
  • blank cells;
  • TRUE and FALSE inside a range.

Numbers and logical values typed straight into the formula are used: =MAX(5,TRUE) returns 5, and =MAX(-5,TRUE) returns 1. If an argument contains an error value, such as #N/A, MAX returns that error.

If there are no numbers at all, MAX returns 0, not an error. That can be misleading: a range of text gives 0, which looks like a real result. Check the range with COUNT if that matters.

Three common patterns

The biggest value in a list. =MAX(B2:B8) returns the highest of seven values. Add more ranges to search several areas at once, such as =MAX(B2:B8,D2:D8).

The latest date. Dates are numbers, so =MAX(A2:A50) returns the most recent date. Format the cell as a date to read it.

A floor. =MAX(0, target - on_hand) returns the shortfall, but never goes below zero. The second argument sets the lowest value the formula can return. Its partner is MIN, which sets a ceiling.

Finding who or what holds the maximum

MAX returns the value, not its label. To get the label, match the maximum back to the list: =INDEX(A2:A8, MATCH(MAX(B2:B8), B2:B8, 0)), or in Microsoft 365, =XLOOKUP(MAX(B2:B8), B2:B8, A2:A8). If two rows tie, both formulas return the first.

With conditions

MAX has no conditions. To find the largest value that meets a test, such as the highest sale in one region, use MAXIFS. To find the second or third largest, use LARGE. To find the smallest value, use MIN.

MAXA is a variant that counts TRUE as 1 and text as 0 in ranges. It is rarely what you want for ordinary numeric data.

Arguments

number1
The first number, cell or range to search, such as B2:B8.
number2, ...optional
More numbers, cells or ranges, up to 255 arguments in all. A typed number acts as a limit, as in MAX(0,B2).

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Highest value in a column

B10 =MAX(B2:B8)

Result: 27

Thursday's 27 is the largest of the seven readings.

B10
A
B
C
1
Day
Peak temp (C)
2
Mon
21
3
Tue
24
4
Wed
19
5
Thu
27
6
Fri
25
7
Sat
22
8
Sun
26
9
10
Hottest day
27

B10 =MAX(B2:B8) returns 27

Example 2

A floor: never go below zero

B4 =MAX(0,B1-B2)

Result: 0

There are 30 units more than the target, so the raw difference is -30. MAX(0, ...) turns that into 0 instead of a negative order.

B4
A
B
C
1
Target stock
120
2
On hand
150
3
4
Units to order
0
5
6

B4 =MAX(0,B1-B2) returns 0

Example 3

The latest date in a list

B6 =MAX(B2:B4)

Result: 12-Feb-2025

Excel stores dates as numbers, so MAX returns the largest serial number, 45700, which displays as 12-Feb-2025.

B6
A
B
C
1
Invoice
Date
2
INV-2201
01-Jan-2025
3
INV-2202
12-Feb-2025
4
INV-2203
02-Feb-2025
5
6
Latest invoice date
12-Feb-2025
7

B6 =MAX(B2:B4) returns 12-Feb-2025

Example 4

Text-only ranges return 0

B5 =MAX(B2:B3)

Result: 0

There are no numbers in the range, so MAX returns 0, not an error. Use COUNT(B2:B3) to check whether any numbers were found.

B5
A
B
C
1
Region
Result
2
North
n/a
3
South
pending
4
5
Largest
0
6

B5 =MAX(B2:B3) returns 0

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 2

In B10, return the highest Q1 sales figure.

Answer in B10.

B10
A
B
C
D
1
Branch
Q1 sales
2
Leeds
48,200
3
Bristol
31,750
4
Derby
42,900
5
Exeter
37,400
6
Hull
22,650
7
York
56,300
8
Poole
39,100
9
10
Highest sales
11
Top branch
12

Common mistakes

  • A range with no numbers returns 0, which looks like a real answer. If the cells might be text, check with COUNT or wrap the formula in an IF.
  • Numbers stored as text are ignored. If MAX returns a value that looks too low, some larger entries may be text. Convert them with VALUE or Text to Columns.
  • MAX returns the value, not its label. To find which row holds the maximum, use INDEX and MATCH or XLOOKUP.
  • A single error value in the range, such as #N/A, makes MAX return that error. Fix the source cell or use AGGREGATE with option 6 to ignore errors.
  • MAX cannot apply a condition. MAX(IF(...)) works in Microsoft 365 but needs Ctrl+Shift+Enter in older versions; MAXIFS is simpler.

Questions people ask

How do I find the highest value that meets a condition?

Use MAXIFS: `=MAXIFS(C2:C9,A2:A9,"East")` returns the largest value in column C where column A is East. It needs Excel 2019 or Microsoft 365.

How do I find the name that goes with the maximum value?

Use `=INDEX(A2:A8,MATCH(MAX(B2:B8),B2:B8,0))`, or in Microsoft 365 `=XLOOKUP(MAX(B2:B8),B2:B8,A2:A8)`. Both return the first name when values tie.

Why does MAX return 0?

Either the largest value is 0, or the range has no numbers in it. Numbers stored as text are not counted, so convert them first.

What is the difference between MAX and LARGE?

MAX returns the single largest value. LARGE returns the nth largest, such as the second or third, so `=LARGE(B2:B8,1)` equals `=MAX(B2:B8)`.

Learn MAX in a real sheet.

MAX is taught in Excel foundations, lesson 6: AVERAGE, MIN and MAX. Each lesson is a short, graded exercise like the one above.