MAXIFS & MINIFS: Find Highest/Lowest Values Based on Conditions

MAXIFS and MINIFS Formula in Excel Blogpost Feature Image
Learn how to use MAXIFS and MINIFS in Excel to find conditional maximum and minimum values. Covers multiple criteria, date ranges, summary grids, and the MAX(IF) fallback for older versions.

MAX and MIN return the highest or lowest value in a range — but they ignore everything else. They cannot filter by region, date, product, or any other condition. The MAXIFS function solves this by returning the largest value that meets one or more criteria. Similarly, the MINIFS function returns the smallest qualifying value. Together, they let you ask questions like "What was the highest single sale in the East region this quarter?" without sorting or filtering the data first.

Both functions belong to the same *IFS family as COUNTIFS, SUMIFS, and AVERAGEIFS. Consequently, their syntax follows an identical pattern — the value range comes first, followed by one or more range-criteria pairs.

Availability: MAXIFS and MINIFS require Excel 2019, Excel 2021, Excel 2024, or Microsoft 365. They are not available in Excel 2016 or earlier. For older versions, use MAX(IF()) or MIN(IF()) array formulas instead — Example 6 covers both approaches.

What Is the Syntax for MAXIFS and MINIFS?

Both functions share the same structure. Only the direction of the result differs.

=MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...) =MINIFS(min_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)
ArgumentRequired?What it does
max_range / min_rangeRequiredThe range containing the numbers to evaluate. Text, blanks, and logical values are ignored. Only rows where all conditions are TRUE contribute to the result.
criteria_range1RequiredThe first range to test. Must be the same size and shape as max_range / min_range.
criteria1RequiredThe condition for criteria_range1. Supports text, numbers, operators (>, <, <>, =), wildcards (* and ?), and cell references joined with &.
criteria_range2, criteria2…OptionalAdditional range-criteria pairs. Each adds another AND condition. Up to 126 pairs are supported.
MAXIFS returns 0, not an error, when no rows match: Unlike AVERAGEIFS which returns #DIV/0!, MAXIFS and MINIFS return 0 when no rows meet the criteria. To distinguish "zero result" from "no match found", wrap in IF: =IF(MAXIFS(...)=0, "No match", MAXIFS(...)) — or use COUNTIFS first to check whether any matching rows exist.

How Do MAXIFS and MINIFS Differ from MAX and MIN?

MAX and MIN have no conditional logic. They evaluate every number in the range. MAXIFS and MINIFS, by contrast, evaluate only the rows where every condition is true. The table below summarises the key differences.

FeatureMAXIFS / MINIFSMAX / MIN
Conditional filtering✅ Up to 126 conditions❌ None — evaluates all rows
Supports operators (>, <, <>)✅ Yes❌ No
Supports wildcards✅ Yes (* and ?)❌ No
Result when no matchReturns 0Returns #VALUE! on empty range
Available in Excel 2016?❌ No — use MAX(IF()) instead✅ Yes — all versions

Example 1: Find the Highest and Lowest Sale in a Region

The most common use is finding the peak or floor value within a specific category. MAXIFS returns the best sale for a region. MINIFS returns the worst. Neither requires sorting or filtering the source data.

1
Find the highest and lowest sale where Region = "East"
A — Region
B — Sales
Included?
MAXIFS result
MINIFS result
East
£1,200
£1,600
£850
North
£2,100
✕ Wrong region
East
£1,600
East
£850
Highest East sale: =MAXIFS(B2:B100, A2:A100, "East") → £1,600 Lowest East sale: =MINIFS(B2:B100, A2:A100, "East") → £850 Use a cell reference for flexible dashboards — F1 holds "East": Changing F1 to "North" instantly recalculates for the North region. =MAXIFS(B2:B100, A2:A100, F1) Spread (range) between best and worst East sale: =MAXIFS(B2:B100, A2:A100, "East") - =MINIFS(B2:B100, A2:A100, "East") → £750 spread in this example
MAXIFS and MINIFS can be subtracted directly to calculate the spread or range within a group. This is a quick way to measure variability — for example, the price range for a product, or the best versus worst day's performance in a month.

Example 2: Two Conditions — Region and Product

Adding a second range-criteria pair narrows the result further. Only rows where both conditions are true contribute to the maximum or minimum. Additional pairs tighten the filter even more — each one adds an AND condition.

2
Highest East-region Widget sale AND lowest East-region Widget sale
Two conditions — Region = East AND Product = Widget. Only rows matching both criteria contribute to the result. =MAXIFS(C2:C100, A2:A100, "East", B2:B100, "Widget") =MINIFS(C2:C100, A2:A100, "East", B2:B100, "Widget") Three conditions — also filter by Status = "Completed": Each pair tests one more column independently. =MAXIFS(C2:C100, A2:A100, "East", B2:B100, "Widget", D2:D100, "Completed") Use cell references for all three criteria — fully flexible dashboard: F1 = Region, G1 = Product, H1 = Status =MAXIFS(C2:C100, A2:A100, F1, B2:B100, G1, D2:D100, H1)
All ranges must be the same size: Every range — max_range, criteria_range1, criteria_range2, and so on — must have the same number of rows and columns. A mismatch in dimensions causes a #VALUE! error. Use the same row numbers throughout: if max_range is B2:B100, all criteria ranges must also reference rows 2 to 100.

Example 3: Find Max and Min Within a Date Range

Date criteria work exactly as they do in SUMIFS and AVERAGEIFS. Two conditions on the same date column create a window. Dynamic date expressions using TODAY() keep the window current without any manual editing.

3
Find the best and worst daily sale within Q1 2026 and the last 30 days
Column A = Date, Column B = Sales. Highest single sale during Q1 2026 (1 Jan – 31 Mar). Use DATE() to avoid regional date format issues. =MAXIFS(B2:B100, A2:A100, ">="&DATE(2026,1,1), A2:A100, "<="&DATE(2026,3,31)) Lowest sale during the same period: =MINIFS(B2:B100, A2:A100, ">="&DATE(2026,1,1), A2:A100, "<="&DATE(2026,3,31)) Dynamic — best sale in the last 30 days (updates automatically with TODAY()): Useful for rolling dashboards with no date maintenance. =MAXIFS(B2:B100, A2:A100, ">="&(TODAY()-30), A2:A100, "<="&TODAY()) Combine date window with a region filter — three conditions total: =MAXIFS(B2:B100, C2:C100, "East", A2:A100, ">="&DATE(2026,1,1), A2:A100, "<="&DATE(2026,3,31))

Example 4: Numeric Bounds — Exclude Outliers

Sometimes you want the highest or lowest value within a specific numeric band — excluding zeros, capping at a threshold, or filtering out extreme values. MAXIFS and MINIFS support comparison operators on the same column as the value range, making this straightforward.

4
Find the highest sale above £0 and the lowest sale under £5,000 in a region
Exclude zeros — find the highest East sale that is genuinely positive: The value range (B) also serves as a criteria range here. =MAXIFS(B2:B100, A2:A100, "East", B2:B100, ">0") Lowest East sale that is below £5,000 — exclude very large outliers: =MINIFS(B2:B100, A2:A100, "East", B2:B100, "<5000") Threshold from a cell — flexible cap stored in D1: Use concatenation (&) to join the operator with the cell reference. =MINIFS(B2:B100, A2:A100, "East", B2:B100, "<"&D1) Highest sale within a band — greater than £200 AND less than £1,000: Both conditions apply to the same column (B = value range and filter). =MAXIFS(B2:B100, B2:B100, ">200", B2:B100, "<1000")
Using the same column for both the value range and a criteria range is valid. This technique filters out zeros, outliers, or values outside a target band — all within a single formula and without any helper columns.

Example 5: Build a Max/Min Summary Table

MAXIFS and MINIFS are ideal for populating summary grids. Place region names in one axis and product names in another. One formula with mixed references then fills the entire grid automatically when copied across and down.

Using Mixed References for the Grid

Lock the value range and criteria ranges fully with $. Use a mixed reference for the row-header criteria — column locked, row free. Similarly, use a mixed reference for the column-header criteria — row locked, column free. As a result, each cell in the grid evaluates the correct combination automatically.

5
Peak and floor sale by Region × Product — one formula fills the grid
Max grid
Widget
Gadget
Min grid
Widget
East
£1,600
£980
East
£850
North
£2,100
£1,340
North
£620
Raw data in columns A (Region), B (Product), C (Sales). Summary grid: regions in column A (A2:A5), products in row 1 (B1:D1). MAXIFS formula in the first summary cell (B2): $A2 → locks column A, row adjusts as formula copies down B$1 → locks row 1, column adjusts as formula copies right =MAXIFS($C$2:$C$500, $A$2:$A$500, $A2, $B$2:$B$500, B$1) MINIFS formula — identical mixed reference structure: =MINIFS($C$2:$C$500, $A$2:$A$500, $A2, $B$2:$B$500, B$1) Copy both formulas across and down to fill the complete grid. Adding a new region row or product column requires no formula editing.

Example 6: Fallback for Excel 2016 — MAX(IF) and MIN(IF)

MAXIFS and MINIFS are not available in Excel 2016 or earlier. For compatibility with older versions, use MAX(IF()) or MIN(IF()) array formulas. In Excel 365 and Excel 2019+, both approaches produce identical results — so MAXIFS is simply the cleaner choice for new files.

When to Use MAX(IF) Instead

Use MAX(IF) specifically when the file will be shared with colleagues who may open it in Excel 2016 or Excel 2013. Otherwise, MAXIFS is always preferable — it is shorter, does not require Ctrl+Shift+Enter, and is easier to extend with additional criteria.

6
MAX(IF) and MIN(IF) array formulas — compatible with all Excel versions
MAX(IF) — enter with Ctrl+Shift+Enter in Excel 2016 and earlier. Excel 365 and Excel 2019+ accept it as a normal formula. Highest East sale, all versions: =MAX(IF(A2:A100="East", B2:B100)) ← press Ctrl+Shift+Enter in Excel 2016 / 2013 MIN(IF) — lowest East sale, all versions: =MIN(IF(A2:A100="East", B2:B100)) Two conditions — multiply the two Boolean arrays (AND logic): Highest East + Widget sale, all versions. =MAX(IF((A2:A100="East")*(B2:B100="Widget"), C2:C100)) ← Ctrl+Shift+Enter in Excel 2016 Side-by-side comparison: MAXIFS → cleaner, no array entry, Excel 2019+ only MAX(IF) → works in all versions, needs Ctrl+Shift+Enter in 2016 MAXIFS version: =MAXIFS(C2:C100, A2:A100, "East", B2:B100, "Widget")
Excel 365 accepts MAX(IF) without Ctrl+Shift+Enter: In Excel 365 and Excel 2021, dynamic array behaviour means MAX(IF()) works as a normal formula without special entry. However, even in those versions, MAXIFS is shorter and more readable — so prefer it whenever the file does not need to be backward-compatible.

How to Fix Common MAXIFS and MINIFS Issues

Result is 0 but you expect a number

MAXIFS returns 0 when no rows match all the criteria. This is different from AVERAGEIFS, which returns a #DIV/0! error. Check the criteria spellings, verify the range sizes all match, and confirm that matching rows exist. Additionally, use COUNTIFS with the same criteria to audit: if it returns 0, no rows match and the 0 result from MAXIFS is correct.

#VALUE! error

A #VALUE! error means at least one criteria_range is a different size or shape from max_range. Every range must have the same row count and column count. For example, if max_range is B2:B100, then every criteria_range must also span rows 2 to 100. Check each range reference individually.

MAXIFS returns 0 but there are matching rows with positive values

The value range may contain numbers stored as text. MAXIFS ignores text values, so it finds no numeric values to compare and returns 0. Verify with ISNUMBER, and convert text-numbers using VALUE() or the Data → Text to Columns tool. Additionally, check whether leading or trailing spaces in the criteria column are causing the match to fail silently.

MAXIFS and MINIFS are not available in Excel 2016: Files containing these functions produce a #NAME? error when opened in Excel 2016 or earlier. For cross-version compatibility, use MAX(IF()) and MIN(IF()) array formulas instead. Consider adding a comment in the workbook to alert users if the file requires Excel 2019 or later.

Frequently Asked Questions

  • What is the difference between MAX and MAXIFS?+
    MAX returns the largest value across an entire range with no filtering. MAXIFS, by contrast, returns the largest value only among the rows that meet all specified conditions. For example, MAX(B2:B100) finds the overall highest sale. MAXIFS(B2:B100, A2:A100, "East") finds the highest sale only in the East region. Consequently, MAXIFS is far more useful for segmented data analysis.
  • Why does MAXIFS return 0 instead of an error when nothing matches?+
    This is by design. MAXIFS returns 0 when no rows meet all the criteria, because 0 is the numeric identity element for a maximum operation — it means "no qualifying value found above zero". This differs from AVERAGEIFS, which returns #DIV/0! on no match. To distinguish a genuine zero result from a no-match result, use COUNTIFS first: if COUNTIFS returns 0, then MAXIFS returning 0 means no matching rows exist rather than a real zero value.
  • How do I use MAXIFS with dates?+
    Use comparison operators joined with the DATE function for reliable date criteria: =MAXIFS(B2:B100, A2:A100, ">="&DATE(2026,1,1), A2:A100, "<="&DATE(2026,3,31)). Hardcoding dates as text strings like "1/1/2026" can cause issues because regional date formats vary. Using DATE() guarantees the correct numeric date value regardless of locale settings.

More Questions About MAXIFS and MINIFS

  • What is the fallback formula for Excel 2016?+
    Use MAX(IF()) as an array formula: =MAX(IF(A2:A100="East", B2:B100)). In Excel 2016 and earlier, confirm with Ctrl+Shift+Enter instead of Enter. For multiple conditions, multiply the Boolean arrays together: =MAX(IF((A2:A100="East")*(B2:B100="Widget"), C2:C100)). In Excel 365 and Excel 2021, these array formulas work as normal formulas without Ctrl+Shift+Enter.
  • Can MAXIFS and MINIFS use wildcards?+
    Yes. Both functions support the asterisk (*) and question mark (?) wildcards in text criteria. An asterisk matches any sequence of characters — for example, "East*" matches "East London" and "East Midlands". A question mark matches exactly one character. To search for a literal asterisk or question mark in the data, prefix it with a tilde: "~*" or "~?". Wildcards are not case-sensitive.
  • Which Excel versions support MAXIFS and MINIFS?+
    MAXIFS and MINIFS are available in Excel 2019, Excel 2021, Excel 2024, and Microsoft 365 on both Windows and Mac. They are also supported in Excel for the web. Notably, they are not available in Excel 2016 or earlier — those versions display a #NAME? error. For backward-compatible files, use MAX(IF()) and MIN(IF()) array formulas as described in Example 6.