Maths functions
MAX and MIN functions in Google Sheets and Excel
MAX returns the largest number in a range or list, and MIN returns the smallest.
MIN is MAX's opposite: the smallest number in a range or list, such as the lowest quantity or the earliest date.
Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet
- Excel 2016
- Excel 2019
- Excel 2021
- Excel 2024
- Microsoft 365
- Google Sheets
Syntax
MAX(number1, [number2], ...)MIN(number1, [number2], ...)Arguments in [brackets] are optional. In Google Sheets: MAX(value1, [value2, ...]) and MIN(value1, [value2, ...]).
Example
=MAX(G2:G13) reads: Look through the twelve unit prices in G2:G13 and return the biggest one.
| A | B | C | D | E | F | G | H | I | J | K | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Order | Date | Customer | Product | Category | Qty | Price | Status | Highest price | $34.00 | |
| 2 | 1001 | 2 Mar 2026 | Mara Okafor | Monstera | Plants | 1 | $34.00 | Shipped | |||
| 3 | 1002 | 2 Mar 2026 | Jonas Lind | Terracotta pot | Pots | 3 | $12.50 | Shipped | |||
| 4 | 1003 | 3 Mar 2026 | Priya Raman | Snake plant | Plants | 2 | $22.00 | Shipped | |||
| 5 | 1004 | 4 Mar 2026 | Tomás Ruiz | Watering can | Tools | 1 | $18.00 | Pending | |||
| 6 | 1005 | 5 Mar 2026 | Elif Demir | Fern | Plants | 4 | $9.50 | Shipped | |||
| 7 | 1006 | 5 Mar 2026 | Mara Okafor | Potting mix | Soil | 2 | $7.25 | Returned | |||
| 8 | 1007 | 6 Mar 2026 | Kenji Mori | Pruning shears | Tools | 1 | $24.00 | Shipped | |||
| 9 | 1008 | 7 Mar 2026 | Ines Varga | Ceramic pot | Pots | 2 | $19.00 | Pending | |||
| 10 | 1009 | 8 Mar 2026 | Jonas Lind | Monstera | Plants | 1 | $34.00 | Shipped | |||
| 11 | 1010 | 9 Mar 2026 | Sofia Rossi | Fern | Plants | 6 | $9.50 | Shipped | |||
| 12 | 1011 | 10 Mar 2026 | Priya Raman | Potting mix | Soil | 5 | $7.25 | Shipped | |||
| 13 | 1012 | 11 Mar 2026 | Leo Brandt | Snake plant | Plants | 1 | $22.00 | Pending |
K1 shows $34.00: the Monstera's price, the biggest number in G2:G13.
How the spreadsheet calculates it
Finds the largest number in G2:G13.
- 1. MAX: Finds the largest number in
G2:G13.range=`G2:G13`: the numbers to look through. Text and empty cells are ignored
MIN example
=MIN(F2:F13) reads: Look through the twelve quantities in F2:F13 and return the smallest one.
| A | B | C | D | E | F | G | H | I | J | K | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Order | Date | Customer | Product | Category | Qty | Price | Status | Smallest qty | 1 | |
| 2 | 1001 | 2 Mar 2026 | Mara Okafor | Monstera | Plants | 1 | $34.00 | Shipped | |||
| 3 | 1002 | 2 Mar 2026 | Jonas Lind | Terracotta pot | Pots | 3 | $12.50 | Shipped | |||
| 4 | 1003 | 3 Mar 2026 | Priya Raman | Snake plant | Plants | 2 | $22.00 | Shipped | |||
| 5 | 1004 | 4 Mar 2026 | Tomás Ruiz | Watering can | Tools | 1 | $18.00 | Pending | |||
| 6 | 1005 | 5 Mar 2026 | Elif Demir | Fern | Plants | 4 | $9.50 | Shipped | |||
| 7 | 1006 | 5 Mar 2026 | Mara Okafor | Potting mix | Soil | 2 | $7.25 | Returned | |||
| 8 | 1007 | 6 Mar 2026 | Kenji Mori | Pruning shears | Tools | 1 | $24.00 | Shipped | |||
| 9 | 1008 | 7 Mar 2026 | Ines Varga | Ceramic pot | Pots | 2 | $19.00 | Pending | |||
| 10 | 1009 | 8 Mar 2026 | Jonas Lind | Monstera | Plants | 1 | $34.00 | Shipped | |||
| 11 | 1010 | 9 Mar 2026 | Sofia Rossi | Fern | Plants | 6 | $9.50 | Shipped | |||
| 12 | 1011 | 10 Mar 2026 | Priya Raman | Potting mix | Soil | 5 | $7.25 | Shipped | |||
| 13 | 1012 | 11 Mar 2026 | Leo Brandt | Snake plant | Plants | 1 | $22.00 | Pending |
K1 shows 1: several orders were for a single item.
More MAX and MIN examples
=MAX(B2:B13)The most recent order date: dates are numbers, so the biggest is the latest.=MAX(C2:E9)The best single month any rep had across the quarter.=MAX(0,D2-C2)How far a budget line went over, or 0 if it stayed under.=MAX(C2:E2)-MIN(C2:E2)The gap between a rep's best and worst month.=XLOOKUP(MAX(G2:G13),G2:G13,D2:D13)The name of the most expensive product.=MIN(B2:B13)The earliest order date in the list.=MIN(C2:E2)A rep's weakest month of the quarter.=MIN(D2,C2)The smaller of actual and budget: what's covered by the budget.=MAX(0,MIN(D2,100))D2 kept between 0 and 100.
Paste any of these into the formula explainer to see it step by step.
Tips
- Use MAX on a date column to find the most recent entry, and MIN for the first.
- Pair MAX or MIN with XLOOKUP or INDEX MATCH to find whose value it is.
- Use
MAX(0, …)to stop a calculation going negative, such as remaining budget. - Leave missing values empty rather than 0, or MIN will report the 0.
What MAX and MIN are used for
The highest and lowest price, sale or score; the latest and earliest date (dates are numbers, so MAX finds the newest); spread (MAX minus MIN); and caps and floors in calculations, such as overspend that can't go below zero.
Arguments
MAX
| Argument | Required | What it is |
|---|---|---|
| number1 | Yes | The first number, cell or range to look through, such as G2:G13. Text and empty cells are ignored. |
| number2, ... | No | Up to 255 numbers, cells or ranges in all; MAX looks through all of them together and returns one value. |
MIN
| Argument | Required | What it is |
|---|---|---|
| number1 | Yes | The first number, cell or range to look through, such as F2:F13. |
| number2, ... | No | Up to 255 numbers, cells or ranges in all, looked through together. |
Common mistakes
Expecting MAX to tell you which row it came from: it returns the value only.
Expecting an error when the range has no numbers: Microsoft documents that MAX returns 0 then, which looks like a real result.
Taking the MAX of dates that were imported as text: they're skipped, so the latest date seems to be missing.
Including a header or total row in the range, so the answer comes from the wrong cell.
Expecting MIN to skip zeros: 0 is a number, so it wins. For the smallest value above zero use
MINIFS(F2:F13,F2:F13,">0").Like MAX, MIN returns 0 when the range holds no numbers at all, so an empty or text-only range looks like a real minimum.
In Google Sheets
Google Sheets has MAX and MIN with the same arguments (value1, value2…), and also the conditional versions MAXIFS and MINIFS.
Errors you may see with MAX and MIN
Questions
How do I find which row has the maximum?
Look the value up: =XLOOKUP(MAX(G2:G13),G2:G13,D2:D13) returns the product with the highest price. With a tie, it returns the first one.
How do I find the maximum with a condition?
Use MAXIFS (or MINIFS): =MAXIFS(G2:G13,E2:E13,"Plants") is the most expensive plant. Both are in Excel 2019 and later and in Google Sheets.
How do I get the second largest or second smallest value?
Use LARGE(G2:G13,2) for the second largest and SMALL(G2:G13,2) for the second smallest; MAX and MIN only give the extremes.
How do I keep a result between limits?
MIN caps a value from above and MAX from below: MIN(D2,100) never goes over 100, MAX(0,D2-C2) never drops below 0. Together, MAX(0,MIN(D2,100)) keeps D2 between 0 and 100.
Sources
Official documentation the facts on this page were checked against.