In Excel: use =MAXIFS(max_range, criteria_range, criteria) — it returns the largest value among the rows meeting your conditions, with MINIFS doing the same for the smallest. Function availability: MAXIFS: Excel 2019+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support.
On this page8
Syntax
Arguments
| Argument | required / optional | Description |
|---|---|---|
max_range | required | The cells to take the maximum (or minimum) of. |
criteria_range1 | required | The range to test, the same size as max_range. |
criteria1 | required | The condition to apply. |
Related functions
Function availability: MAXIFS: Excel 2019+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support.
Select the result cell and type =MAXIFS( or =MINIFS(.
Select the column of numbers first, then a comma.
Select the condition column, add a comma, and type the condition in quotes.
Add further range-and-criterion pairs as needed, then press Enter.
What this does
MAXIFS and MINIFS return the largest and smallest values among rows that satisfy every condition given. Before Excel 2019 this required an array formula entered with Ctrl+Shift+Enter, which is why so many older workbooks still carry that pattern. Conditions combine with AND only. When nothing matches they return 0 rather than an error, and that is the trap: a legitimate zero and "no rows matched" look identical, so a COUNTIFS guard is worth adding wherever the distinction matters. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. For “minifs function”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected formula change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a calculation you can defend to a CFO or an auditor useful in real work: repeatable, auditable, and not dependent on memory or luck.
A worked example
Deal values in D2:D500 with regions in A2:A500: =MAXIFS(D2:D500, A2:A500, "West") returns the largest Western deal. The smallest order above a floor: =MINIFS(D2:D500, D2:D500, ">0"). Guarding against the silent zero: =IF(COUNTIFS(A2:A500,"West")=0, "none", MAXIFS(D2:D500, A2:A500, "West")). MAXIFS and MINIFS collapse the old Ctrl+Shift+Enter array idiom into an ordinary formula, which makes conditional extremes readable again. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.
In Google Sheets
Function availability: MAXIFS: Excel 2019+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support. Nothing on this page is behind a login or a download: the exact answer is at the top, and the detail below it is there for when you need it. That is the whole promise here — the answer first, and just enough context to make it stick. For “minifs function”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.
Common mistakes
- Reading the 0 returned when nothing matches as a real minimum or maximum — add a
COUNTIFScheck. - Using them in Excel 2016 or earlier, where they do not exist; there,
MAXwith anIFarray is the fallback. - Expecting
ORlogic across conditions, which is not supported — every criterion must hold.
Frequently asked questions
What do MAXIFS and MINIFS return when nothing matches?
Zero, not an error. Wrap them in a COUNTIFS test if a real zero would be ambiguous in your data.
Which Excel versions have them?
Excel 2019 and later, plus Microsoft 365 and Google Sheets. Earlier versions need an array formula with MAX and IF.
Can I use more than one condition?
Yes — add further criteria-range and criteria pairs. They are combined with AND.
Which Excel release does this formula require?
Function availability: MAXIFS: Excel 2019+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support.