ExcelReady
CourseFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before the interview. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Function guides
  • Blog

Product

  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Conditional math
  3. MAXIFS and MINIFS: Highest and Lowest With Conditions

MAXIFS and MINIFS: Highest and Lowest With Conditions

By ExcelReady Team·Updated October 30, 2026·7 min read

The short answer

MAXIFS returns the highest number among the rows that meet one or more conditions, and MINIFS returns the lowest. Both put the numbers first, then range/criteria pairs: =MAXIFS(D2:D9,B2:B9,"Marketing") finds the top Marketing salary. They need Excel 2019 or newer. If nothing matches, they return 0, not an error.

Key takeaways

  • Syntax: =MAXIFS(max_range, criteria_range1, criteria1, ...). MINIFS is the same with min_range.
  • The numbers come first, like SUMIFS, not last, like SUMIF.
  • If no row matches, MAXIFS and MINIFS return 0, so check for that before you trust the result.
  • MAXIFS and MINIFS need Excel 2019, 2021, 2024 or Microsoft 365. In older Excel, use MAX(IF(...)).
On this page+
  1. What do MAXIFS and MINIFS do?
  2. How to use MAXIFS in Excel
  3. How to use MINIFS in Excel
  4. MAXIFS and MINIFS with multiple conditions
  5. Why does MAXIFS return 0?
  6. How to find the latest or earliest date with MAXIFS
  7. What to use in Excel 2016 and older
  8. Practise it

Excel MAXIFS finds the highest value among the rows that meet your conditions, such as the top salary in Marketing. MINIFS finds the lowest, such as the lowest Junior salary in Finance. Both work like SUMIFS, with the numbers first and then range/criteria pairs. This guide covers the syntax, worked examples, the surprising 0 result, and what to use in Excel 2016 and older.

What do MAXIFS and MINIFS do?#

MAXIFS and MINIFS look only at rows that match every condition, then return the largest or smallest number from those rows. The syntax:

Excel formula
=MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
=MINIFS(min_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
PartWhat it meansExample
max_range / min_rangeThe numbers to compareD2:D9 (Salary)
criteria_range1The first column to checkB2:B9 (Department)
criteria1What it must match"Marketing"

Version note: MAXIFS and MINIFS need Excel 2019, Excel 2021, Excel 2024, Microsoft 365 or Excel for the web. In Excel 2016 and older they show #NAME?.

The examples use this staff table in A1:E9:

ABCDE
1EmployeeDepartmentLevelSalaryYears
2NoorFinanceSenior920008
3FelixEngineeringJunior680001
4IvyEngineeringSenior1180009
5KenjiFinanceJunior580002
6LaraMarketingSenior840007
7MiloEngineeringMid950004
8NiaMarketingJunior520001
9OscarFinanceMid740005

How to use MAXIFS in Excel#

Put the numbers first, then the column to check and its criteria. For the top salary in Marketing:

Excel formula
=MAXIFS(D2:D9,B2:B9,"Marketing")

The result is 84,000 (Lara). Excel looks at the two Marketing rows, 84,000 and 52,000, and returns the larger.

Here is what plain MAX would do: =MAX(D2:D9) returns 118,000, the top salary in the whole company. MAXIFS narrows it to one group.

How to use MINIFS in Excel#

MINIFS has exactly the same shape and returns the smallest value. For the lowest Engineering salary:

Excel formula
=MINIFS(D2:D9,B2:B9,"Engineering")

The result is 68,000 (Felix). Comparisons work too. The lowest salary among people with 5 or more years:

Excel formula
=MINIFS(D2:D9,E2:E9,">=5")

Noor, Ivy, Lara and Oscar match, so the result is 74,000 (Oscar).

MAXIFS and MINIFS with multiple conditions#

Add one range/criteria pair per condition. A row must match every pair to be included. The highest Engineering salary for people with fewer than 5 years:

Excel formula
=MAXIFS(D2:D9,B2:B9,"Engineering",E2:E9,"<5")

Felix (1 year) and Milo (4 years) match, so the result is 95,000.

To fill a summary, point the criteria at a cell. Put Finance, Marketing and Engineering in G8:G10, and type this in H8 to find the lowest Junior salary in each department:

Excel formula
=MINIFS($D$2:$D$9,$B$2:$B$9,G8,$C$2:$C$9,"Junior")

Fill down to H10 (Windows: Ctrl+D; Mac: ⌘D). You get 58,000 for Finance, 52,000 for Marketing and 68,000 for Engineering. The $ signs keep the data ranges fixed while G8 moves down.

To let someone change a limit without editing the formula, join an operator to a cell. If J1 holds 5, this finds the top salary among people with fewer than 5 years:

Excel formula
=MAXIFS(D2:D9,E2:E9,"<"&J1)

Felix, Kenji, Milo and Nia match, so the result is 95,000. Keep the < in quotes and J1 outside them.

Criteria can also be partial text. "Eng*" matches any department starting with Eng; see how wildcards work in criteria.

How to find who has the top value#

MAXIFS returns the number, not the person. To get the name next to it, look the result up. With the top Marketing salary in H2:

Excel formula
=XLOOKUP(1,(B2:B9="Marketing")*(D2:D9=H2),A2:A9)

The result is Lara. The two tests in brackets each give TRUE or FALSE, and multiplying them gives 1 only where both are true, so the lookup finds the Marketing row with that salary. Checking the department as well matters: a plain lookup of 84,000 could find someone in another department with the same pay. XLOOKUP needs Excel 2021 or Microsoft 365; see how XLOOKUP works.

Why does MAXIFS return 0?#

MAXIFS and MINIFS return 0 when no row matches, not an error. That is easy to miss, because 0 looks like a real answer.

For example, =MAXIFS(D2:D9,B2:B9,"Sales") returns 0 because there is no Sales department. If 0 could be a real value in your data, check that matches exist first:

Excel formula
=IF(COUNTIF(B2:B9,"Sales")=0,"No match",MAXIFS(D2:D9,B2:B9,"Sales"))

This shows "No match" instead of a misleading 0. COUNTIF is the quickest way to confirm how many rows meet a condition.

Other common problems:

  • #VALUE!: the ranges are different sizes. Make every range cover the same rows.
  • Numbers on the wrong side: =MAXIFS(B2:B9,"Marketing",D2:D9) follows the SUMIF order and fails. The numbers go first.
  • Text numbers: salaries stored as text are ignored. Convert them with VALUE.

How to find the latest or earliest date with MAXIFS#

Excel stores dates as numbers, so MAXIFS returns the latest date and MINIFS the earliest. If column A holds order dates and column B holds customer names, =MAXIFS(A2:A100,B2:B100,"Acme") returns Acme's most recent order date. If the cell shows a number like 45700, format it as a date.

To total or count orders between two dates instead, see how to sum by date range with SUMIFS.

What to use in Excel 2016 and older#

Without MAXIFS, use MAX with IF inside it as an array formula, a formula that works on a whole range at once:

Excel formula
=MAX(IF(B2:B9="Marketing",D2:D9))

In Excel 2016 and older, press Ctrl+Shift+Enter instead of Enter, and Excel adds curly brackets around the formula. In Microsoft 365, plain Enter works. IF returns the salary for Marketing rows and FALSE for the others, and MAX ignores the FALSE values, so the result is 84,000. For two conditions, multiply the tests:

Excel formula
=MIN(IF((B2:B9="Engineering")*(C2:C9="Junior"),D2:D9))

That returns 68,000. Like MAXIFS, these return 0 when nothing matches.

Practise it#

MAXIFS and MINIFS are taught together with AVERAGEIF in one hands-on lesson. Practise AVERAGEIF, MAXIFS and MINIFS in a live spreadsheet: find the top Marketing salary, then fill a MINIFS summary of the lowest Junior pay per department.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

What is the highest salary in Finance? Click H2 and use MAXIFS: the Salary column (D2:D9) first, then the Department column (B2:B9) and "Finance".

fx
ABCDEFGHI
1
Employee
Department
Level
Salary
Years
2
Noor
Finance
Senior
92000
8
Top Finance salary
3
Felix
Engineering
Junior
68000
1
4
Ivy
Engineering
Senior
118000
9
5
Kenji
Finance
Junior
58000
2
6
Lara
Marketing
Senior
84000
7
7
Milo
Engineering
Mid
95000
4
8
Nia
Marketing
Junior
52000
1
9
Oscar
Finance
Mid
74000
5
10
11
12

Tip: The Salary range comes first, not last.

Practise this in a lesson

LessonAVERAGEIF, MAXIFS and MINIFSFind the average, highest and lowest values that meet one or more conditions.

Frequently asked questions

What does MAXIFS do in Excel?

+

MAXIFS returns the largest value in a range, counting only the rows that meet your conditions. For example, =MAXIFS(D2:D9,B2:B9,"Marketing") returns the highest Marketing salary.

Why does MAXIFS return 0?

+

No row matched all your conditions, so there was nothing to compare. Check the criteria for typos and extra spaces, and make sure each criteria range is the right column.

Which Excel versions have MAXIFS and MINIFS?

+

Excel 2019, Excel 2021, Excel 2024, Microsoft 365 and Excel for the web. Excel 2016 and older don't have them and show #NAME?.

What can I use instead of MAXIFS in Excel 2016?

+

Use =MAX(IF(B2:B9="Marketing",D2:D9)) and confirm it with Ctrl+Shift+Enter, which makes it an array formula. MIN(IF(...)) works the same way for MINIFS.

Can MAXIFS find the latest date?

+

Yes. Dates are numbers in Excel, so MAXIFS on a date column returns the latest date that meets the conditions. Format the result cell as a date.

Sources

  • MAXIFS function - Microsoft Support
  • MINIFS function - Microsoft Support

Written and checked by the ExcelReady Team. First published October 30, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What do MAXIFS and MINIFS do?
  2. How to use MAXIFS in Excel
  3. How to use MINIFS in Excel
  4. MAXIFS and MINIFS with multiple conditions
  5. Why does MAXIFS return 0?
  6. How to find the latest or earliest date with MAXIFS
  7. What to use in Excel 2016 and older
  8. Practise it

Keep reading

Conditional math· 7 min read

Excel Wildcards: *, ? and ~ in COUNTIF and SUMIF

Excel has three wildcard characters for criteria. An asterisk (*) matches any number of characters, so "CAB-*" means starts with CAB-. A question mark (?) matches exactly one character. A tilde (~) before * or ? makes it a normal character. Use them inside quotes in COUNTIF, SUMIF, COUNTIFS and SUMIFS, for example =COUNTIF(A2:A9,"CAB-*").

Conditional math· 7 min read

Sum by Date Range or Month in Excel With SUMIFS

To sum between two dates, give SUMIFS the same date column twice: once with ">="&start and once with "<"&end. For January 2025, write =SUMIFS(D2:D9,A2:A9,">="&DATE(2025,1,1),A2:A9,"<"&DATE(2025,2,1)). Keep the operator in quotes and join the date with &. Using "before the 1st of next month" works for every month.

Conditional math· 6 min read

How to Use COUNTIF in Excel (With Criteria Examples)

COUNTIF counts the cells in a range that meet one condition. Write =COUNTIF(range, criteria), for example =COUNTIF(D2:D9,"Open") to count open tickets. Put text and comparisons in double quotes, like ">=8" or "<>Low". Numbers and cell references go in without quotes. For two or more conditions, use COUNTIFS.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback. The first lessons are free, with no download.

Start learning for free