formulastreak

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

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.

Leaf & Loam orders · edit K1 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultK1 = $34.00
ABCDEFGHIJK
1OrderDateCustomerProductCategoryQtyPriceStatusHighest price$34.00
210012 Mar 2026Mara OkaforMonsteraPlants1$34.00Shipped
310022 Mar 2026Jonas LindTerracotta potPots3$12.50Shipped
410033 Mar 2026Priya RamanSnake plantPlants2$22.00Shipped
510044 Mar 2026Tomás RuizWatering canTools1$18.00Pending
610055 Mar 2026Elif DemirFernPlants4$9.50Shipped
710065 Mar 2026Mara OkaforPotting mixSoil2$7.25Returned
810076 Mar 2026Kenji MoriPruning shearsTools1$24.00Shipped
910087 Mar 2026Ines VargaCeramic potPots2$19.00Pending
1010098 Mar 2026Jonas LindMonsteraPlants1$34.00Shipped
1110109 Mar 2026Sofia RossiFernPlants6$9.50Shipped
12101110 Mar 2026Priya RamanPotting mixSoil5$7.25Shipped
13101211 Mar 2026Leo BrandtSnake plantPlants1$22.00Pending

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. 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.

Leaf & Loam orders · edit K1 and watch it recalculate
Click a cell (or use the arrow keys) to insert its address · Enter shows the resultK1 = 1
ABCDEFGHIJK
1OrderDateCustomerProductCategoryQtyPriceStatusSmallest qty1
210012 Mar 2026Mara OkaforMonsteraPlants1$34.00Shipped
310022 Mar 2026Jonas LindTerracotta potPots3$12.50Shipped
410033 Mar 2026Priya RamanSnake plantPlants2$22.00Shipped
510044 Mar 2026Tomás RuizWatering canTools1$18.00Pending
610055 Mar 2026Elif DemirFernPlants4$9.50Shipped
710065 Mar 2026Mara OkaforPotting mixSoil2$7.25Returned
810076 Mar 2026Kenji MoriPruning shearsTools1$24.00Shipped
910087 Mar 2026Ines VargaCeramic potPots2$19.00Pending
1010098 Mar 2026Jonas LindMonsteraPlants1$34.00Shipped
1110109 Mar 2026Sofia RossiFernPlants6$9.50Shipped
12101110 Mar 2026Priya RamanPotting mixSoil5$7.25Shipped
13101211 Mar 2026Leo BrandtSnake plantPlants1$22.00Pending

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

ArgumentRequiredWhat it is
number1YesThe first number, cell or range to look through, such as G2:G13. Text and empty cells are ignored.
number2, ...NoUp to 255 numbers, cells or ranges in all; MAX looks through all of them together and returns one value.

MIN

ArgumentRequiredWhat it is
number1YesThe first number, cell or range to look through, such as F2:F13.
number2, ...NoUp 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

  • #N/A: A cell in the range shows #N/A (often a lookup that found nothing). MAX and MIN pass the error on instead of skipping it.
  • #VALUE!: A text value typed straight into the formula, such as `=MAX("high",5)`, that can't be read as a number.

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.

Practise MAX and MIN on a live sheet

Lesson 6, AVERAGE, MAX and MIN (Unit 2, Ranges and functions), has 4 graded exercises, checked instantly, with steps and hints when you're stuck.