MAXIFS
Returns the maximum numeric value in a range that meets all criteria.
MAXIFS applies one or more (criteria_range, criteria) pairs and returns the largest
matching numeric value.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=MAXIFS(max_range, criteria_range1, criteria1, [(criteria_range2, criteria2), ...])
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
max_range | any | Required | — |
criteria_range1 | any | Required | — |
criteria1 | any | Required | — |
criteria_range2 | any | Optional | — |
criteria2 | any | Optional | — |
Accepts a variable number of arguments. Minimum: 3.
Remarks
- An equality criterion for a date or number (
"10/26/1999","36459",36459) also matches text cells holding that date;<>and ordering criteria do not read date text. - Arguments must be
target_rangeplus one or more criteria pairs. - Criteria are combined with logical AND.
- Returns
0when no cells satisfy all criteria. - Non-numeric cells in
target_rangeare ignored.
Examples
Aggregate numbers from only the East records.
Formula =MAXIFS(A1:A3,B1:B3,"East")
| A | B | |
|---|---|---|
| 1 | 10 | "East" |
| 2 | 50 | "West" |
| 3 | 20 | "East" |
Expected result 20
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Add a second criterion so both conditions must hold.
Formula =MAXIFS(A1:A3,B1:B3,"East",C1:C3,"<5")
| A | B | C | |
|---|---|---|---|
| 1 | 10 | "East" | 2 |
| 2 | 50 | "West" | 4 |
| 3 | 20 | "East" | 6 |
Expected result 10
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Aggregate the only row in a single-row data set.
Formula =MAXIFS(A1:A1,B1:B1,"East",C1:C1,2)
| A | B | C | |
|---|---|---|---|
| 1 | 10 | "East" | 2 |
Expected result 10
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Maximum value for one condition
Formula =MAXIFS(A1:A3,B1:B3,"East")
| A | B | |
|---|---|---|
| 1 | 10 | "East" |
| 2 | 20 | "West" |
| 3 | 15 | "East" |
Expected result 15
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Maximum value with two criteria
Formula =MAXIFS(A1:A4,B1:B4,"B",C1:C4,"Q1")
| A | B | C | |
|---|---|---|---|
| 1 | 100 | "A" | "Q1" |
| 2 | 80 | "A" | "Q2" |
| 3 | 90 | "B" | "Q1" |
| 4 | 70 | "B" | "Q1" |
Expected result 90
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
What does MAXIFS return when no rows match all criteria?
It returns 0 when no numeric target cells satisfy every criterion.