Spreadsheet Practice

MAXIFS function

MAXIFS returns the largest value among the rows that meet one or more conditions: the biggest deal in a region, the latest order date for a customer. It follows the SUMIFS layout, with the range to search first. When nothing matches it returns 0 rather than an error, so check for that.

Available in
Excel 2019 and later, including Microsoft 365
Category
Conditional sum and count functions
Returns
The largest matching value, or 0 if no row meets the conditions.
Google Sheets
Also available in Google Sheets.

Syntax

=MAXIFS(max_range, criteria_range1, criteria1, ...)

ArgumentRequired?What it is
max_rangeRequiredThe cells to find the largest value in.
criteria_range1RequiredThe first range to check.
criteria1RequiredThe condition for the first range.

Examples

Each result below is calculated from the sample sheet by our formula engine, the same one that grades the practice.

CellFormulaResultWhat it shows
G2=MAXIFS(C2:C8,B2:B8,"East")$31,000The biggest deal in the East region
G3=MAXIFS(C2:C8,B2:B8,"East",D2:D8,"Closed")$26,200Add a second condition to skip open deals
G4=MAXIFS(C2:C8,B2:B8,"South")$0No South deals: MAXIFS returns 0, not an error

Try it live

This is the sample sheet. Change any number or text, or edit a formula, and the results update.

Show the sample data as a table
DealRegionValueStageCheckResult
D-01East$18,500ClosedLargest East deal$31,000
D-02West$22,400OpenLargest closed East deal$26,200
D-03East$31,000OpenLargest South deal$0
D-04East$12,750Closed
D-05North$9,800Closed
D-06West$15,600Closed
D-07East$26,200Closed

Practice MAXIFS

Graded instantly, then re-checked on changed data.

Last order date per customer

In F2, return the most recent order date for the customer in E2. Fill down to F4.

Common mistakes

What you seeWhy, and how to fix it
A 0 that should be "no data"MAXIFS returns 0 when nothing matches. Check with COUNTIFS first, or use IF(COUNTIFS(...)=0,"",MAXIFS(...)).
#NAME?Your version is older than Excel 2019. Use =MAX(IF(B2:B8="East",C2:C8)) instead, confirmed with Ctrl+Shift+Enter in old versions.
#VALUE!max_range and the criteria ranges are different sizes.

Tips

  • MAXIFS on a date column returns the most recent matching date, like a customer's last order.

Questions

How do I find the max value with a condition in Excel?

Use =MAXIFS(C2:C8,B2:B8,"East") in Excel 2019 or later.

Why does MAXIFS return 0?

No rows met the conditions. MAXIFS returns 0 instead of an error in that case.

Last reviewed October 2026. Every example result on this page is calculated live by the Spreadsheet Practice formula engine.