The MAX function
MAX returns the highest number it's given: the biggest sale, the latest reading or the wettest month. Text and blank cells in a range are ignored.
It also has a handy second use. =MAX(0, something) never goes below zero, which is useful for things like "amount still owed".
=MAX(number1, [number2], ...)
Arguments
- number1
- The first number, cell or range to check.
- number2, ...optional
- More numbers, cells or ranges to compare.
Try it
=MAX(B2:B7) in D2. January had the most rain of the six months, 88.2 mm.
D2
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Month | Rainfall (mm) | Wettest | ||
| 2 | Jan | 88.2 | 88.2 | ||
| 3 | Feb | 61.4 | |||
| 4 | Mar | 70.9 | |||
| 5 | Apr | 45.3 | |||
| 6 | May | 52 | |||
| 7 | Jun | 38.6 | |||
| 8 | |||||
| 9 |
Edit the formula in D2, or change the data, and press Enter.
More examples
| Formula | Result | What it does |
|---|---|---|
| =MAX(B4:B7) | 70.9 | The wettest month from March onwards. |
| =INDEX(A2:A7,MATCH(MAX(B2:B7),B2:B7,0)) | Jan | MATCH finds which row holds the maximum and INDEX returns the month name. |
| =MAX(B2:B7)-MIN(B2:B7) | 49.6 | The range of the data: wettest minus driest. |
| =MAX(0,B5-50) | 0 | April was 4.7 mm under 50, but MAX(0, …) stops the result going negative. |
Tips
- To find the second or third highest value, use LARGE.
- MAX on a column of dates gives the most recent date.
- For the largest value that meets a condition, Excel 2019 and later and Google Sheets have MAXIFS.
Common mistakes
- MAX returns 0.There are no real numbers in the range, often because they were pasted in as text. Convert them to numbers.
- MAX picks up a total.The range runs into a total row at the bottom. End the range above it.
Practise MAX with instant feedback
Type real formulas into a working spreadsheet and get told straight away whether they work.