ShareYourGroupShareYourGroupExcel Formulas

Statistical functions

MAX, MIN, MAXIFS and MINIFS functions in Excel

MAX and MIN return the largest and smallest numbers in a range; MAXIFS and MINIFS do the same for the rows that meet conditions.

MAX and MIN find the extremes: the top mark, the lowest price, the latest date, the earliest order. They are simple to use, and a few patterns built on them are worth knowing.

Syntax

=MAX(number1, [number2], ...)
=MIN(number1, [number2], ...)
=MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
=MINIFS(min_range, criteria_range1, criteria1, ...)
ArgumentWhat it is
number1, number2, ...Numbers, cells or ranges.
max_range, min_rangeThe cells to take the largest or smallest value from.
criteria_range1, criteria1A range to test and its condition, as in SUMIFS.

Examples

Each result below is what Excel itself showed for the formula on the sample sheet.

Sample sheet: Marks of eight students in three subjects. One Science mark is missing (cell D6 is empty).
ABCDE
1NameClassMathsScienceEnglish
2Asha8A788591
3Ravi8B455260
4Meena8A928879
5Kabir8B334138
6Tara8A6772
7Joy8B889084
8Neha8A546158
9Imran8B787369

How they work

Both look through every number you give them. Text, empty cells and TRUE or FALSE inside a range are ignored. If a range has no numbers at all, the result is 0, which can be misleading: a MAX of 0 may mean "no data", not "the largest is zero".

Dates are numbers, so =MAX(A2:A13) on a column of dates returns the latest date and MIN the earliest. Format the result cell as a date.

Whose value is it?

MAX tells you the highest mark, not who scored it. To get the name, find the position of the maximum and read the name from the same position, as the sixth example does:

=INDEX(names, MATCH(MAX(marks), marks, 0))

In Excel 2021 and Microsoft 365, XLOOKUP is shorter: =XLOOKUP(MAX(C2:C9),C2:C9,A2:A9). If two students share the top mark, both formulas return the first. FILTER lists them all.

Conditions: MAXIFS and MINIFS

MAXIFS and MINIFS return the largest or smallest value among the rows that pass one or more conditions: the best mark in one class, the cheapest item in one category, the latest order of one customer. Their arguments follow the pattern of SUMIFS: the range to take the answer from comes first, then pairs of range and condition.

They are available in Excel 2019, Excel 2021 and Microsoft 365. When no row matches, they return 0.

Limits and floors

MAX and MIN are a tidy way to stop a calculated value going out of bounds.

People often write these with IF. =MAX(0,A1-B1) says the same as =IF(A1-B1<0,0,A1-B1) in half the space, and names the cells once.

The smallest value that is not zero

Zeros often stand for "nothing entered", and MIN then returns 0. To skip them: =MINIFS(C2:C9,C2:C9,">0").

Second highest, third lowest

MAX and MIN give only the very top and bottom. For the second, third or any other place, use LARGE and SMALL. For a position in the order, use RANK.

Common mistakes

In Google Sheets

MAX, MIN, MAXIFS and MINIFS are all available in Google Sheets.

Related functions

Every result on this page was calculated in Microsoft Excel (version 16.0, build 20326) on 12 November 2026, not typed by hand.

This is an independent help site. It is not connected with or approved by Microsoft. Excel and Microsoft 365 are trademarks of Microsoft Corporation, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.