How to Maximum If Multiple Criteria in Excel
Learn multiple Excel methods to calculate a maximum value that meets several conditions at once, with step-by-step examples, troubleshooting tips, and best practices.
How to Maximum If Multiple Criteria in Excel
Why This Task Matters in Excel
Every analyst eventually faces the question, “What is the highest value that satisfies all of my business rules?” Whether you are looking for the top sales figure in a specific region, the latest delivery date within a particular project phase, or the maximum discount applied to a certain product line, returning a conditional maximum is an essential building block of decision-making.
In finance, portfolio managers often need to know the highest daily return for a single stock during a given quarter. Marketing teams might look for the maximum number of clicks for campaigns that ran on a particular platform while staying under a fixed budget. Operations departments may want to identify the maximum downtime for machines of a certain model produced in a certain year to prioritize maintenance. All of these requests involve multiple filters followed by a single “greatest value” calculation—exactly what a “maximum if multiple criteria” formula delivers.
Excel is particularly well-suited for this task because it combines a relational grid structure with a robust formula engine. You can create large, filter-like calculations in a single cell without writing any VBA or SQL. For modern Excel users (Microsoft 365 or Excel 2019+), the MAXIFS function handles this directly. If you are on an older version (Excel 2016 and earlier) or need more advanced control, array formulas with MAX and IF, the AGGREGATE function, or the FILTER function paired with MAX all provide viable alternatives.
Not mastering this skill often means resorting to manual filters, PivotTables, or copying data into new sheets—processes that waste time and introduce errors. Moreover, advanced reporting tools such as Power Pivot, Power BI, or Tableau frequently start with a clean, reliable Excel model. Learning conditional maximum techniques therefore improves data quality and speeds up downstream analysis.
Best Excel Approach
The most effective method depends on your Excel version and data size:
- MAXIFS (modern Excel) – single-cell, easy to read, no CSE (Control-Shift-Enter) needed.
- MAX + IF (array formula) – reliable fallback when MAXIFS is unavailable.
- FILTER + MAX (dynamic arrays) – extremely flexible for many criteria or spill outputs.
- AGGREGATE (special cases) – useful for ignoring errors or hidden rows.
- DMAX (database functions) – intuitive for users comfortable with criteria ranges.
For most users on Microsoft 365 or Excel 2019+, MAXIFS is the clear winner because it is purpose-built: it calculates the maximum of a range based on one or more criteria ranges. It avoids the sometimes intimidating syntax of older array formulas and calculates quickly on large datasets.
Syntax:
=MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], …)
Parameters
- max_range – cells that contain the numeric values to evaluate
- criteria_range1 – first range to test
- criteria1 – condition applied to criteria_range1
- Additional pairs – optional extra conditions
Alternative (legacy):
=MAX(IF((criteria_range1=criteria1)*(criteria_range2=criteria2), max_range))
This array formula is confirmed with Ctrl + Shift + Enter in pre-365 Excel.
Parameters and Inputs
- Data ranges must be the same size and shape. If [A2:A100] is your region column, every additional criteria range plus the max_range must also span 99 rows.
- max_range requires numeric data. Text or blanks are ignored automatically by MAXIFS but cause errors with MAX alone, so clean your numbers first.
- criteria can be constants (\"North\"), references (E2), wildcards (\"Q?\"), or logical operators (\">=2023-01-01\").
- Wildcards work only on text comparisons.
- Date criteria should be entered as real Excel dates or wrapped inside the DATE function to avoid regional ambiguity.
- For optional criteria pairs, MAXIFS can handle up to 126 conditions; performance may drop after roughly 10–15 on very large datasets.
- In array formulas, multiplying logical tests coerces TRUE/FALSE values to 1/0, producing a mask that filters the max_range. Missing data or mismatched sizes return #VALUE!.
- To handle possible blanks in max_range for array methods, wrap the formula in IFERROR or use the AGGREGATE alternative.
Step-by-Step Examples
Example 1: Basic Scenario
Imagine you track monthly revenue by region and quarter in a simple table:
| A (Region) | B (Quarter) | C (Revenue) |
|---|---|---|
| North | Q1 | 18500 |
| South | Q1 | 21200 |
| North | Q2 | 19800 |
| South | Q2 | 23100 |
| North | Q1 | 20700 |
Goal: highest revenue for the “North” region in “Q1”.
Step 1 – Select an output cell, e.g., E2.
Step 2 – Enter the formula:
=MAXIFS([C2:C6],[A2:A6],"North",[B2:B6],"Q1")
Press Enter. Result: 20700.
Why it works: MAXIFS checks each row where Region equals \"North\" and Quarter equals \"Q1\". Only rows 1 and 5 meet both conditions; among their revenue values [18500, 20700], the maximum is 20700.
Variations:
- Change \"North\" to a cell reference to make the formula dynamic.
- Add a third criterion, such as Year, by extending the criteria_range/criteria pairs.
Troubleshooting: If you see #VALUE!, confirm that all ranges are [C2:C6] length. A #SPILL! error in modern Excel means an adjacent cell blocks output—rare here because MAXIFS returns a single value.
Example 2: Real-World Application
Scenario: A retail chain keeps a detailed transaction log with the following columns:
- Date (column A)
- StoreID (column B)
- ProductCategory (column C)
- SalesAmount (column D)
- Discount% (column E)
Management asks: “What is the maximum discount applied to ‘Electronics’ in Store 105 during Black Friday week (Nov 20–Nov 26, 2023)?”
Data set extends to row 20 000.
Step 1 – Define a named range for the date span:
- In I1 enter start date = 2023-11-20
- In I2 enter end date = 2023-11-26
Step 2 – Use MAXIFS:
=MAXIFS([E2:E20001],
[C2:C20001],"Electronics",
[B2:B20001],105,
[A2:A20001],">=" & $I$1,
[A2:A20001],"<=" & $I$2)
Key points:
- Concatenate relational operators with cell references for flexible date limits.
- StoreID compared to a number (105).
- MAXIFS evaluates roughly 100 000 criteria checks (20 000 rows × 5 conditions) instantly in 365.
Business value: instantly identifies the steepest discount for compliance review—no filters, no PivotTables.
Integration: The formula can feed a dashboard. For instance, pair it with conditional formatting to highlight transactions where the Discount% equals the output value, giving managers immediate visibility.
Performance: On 20 000 rows, MAXIFS completes in milliseconds. Using volatile functions such as TODAY() in criteria will recalculate at every workbook refresh, so consider storing snapshot dates in helper cells as shown.
Example 3: Advanced Technique
Scenario: You manage a global fleet of delivery vehicles and log telematics data. The sheet has:
- VehicleID (column A)
- Region (column B)
- VehicleType (column C)
- TripDate (column D)
- TotalDistance (column E)
- AverageSpeed (column F)
- FuelEfficiency (column G)
Goal: For electric vans in the “West Coast” region, find the maximum average speed in the latest quarter, but ignore any trip where FuelEfficiency is blank or zero (sensor failure). You also want the row details, not just the value.
Modern Excel solution using FILTER + MAX:
=LET(
data, FILTER([A2:G50000],
([B2:B50000]="West Coast")*
([C2:C50000]="Electric Van")*
([D2:D50000]>= DATE(2024,1,1))*
([D2:D50000]<= DATE(2024,3,31))*
([G2:G50000]<>0)),
maxSpeed, MAX(INDEX(data,,6)),
filterRows, FILTER(data, INDEX(data,,6)=maxSpeed),
filterRows)
Explanation:
- FILTER narrows the dataset based on four conditions, returning a spill range of matching rows.
- MAX retrieves the highest AverageSpeed (column 6 of the filtered array).
- FILTER again returns only rows whose AverageSpeed equals that maximum.
- LET stores intermediate calculations for speed and readability. The final result is a dynamic spill that includes VehicleID, Region, VehicleType, TripDate, TotalDistance, AverageSpeed, FuelEfficiency for the record-breaking trip(s).
Edge cases: Multiple vehicles might tie for the same speed. Using FILTER ensures you capture every matching record.
Performance optimization: LET avoids recalculating the FILTER result twice, halving recalc time on larger datasets. If you still experience lag, consider adding helper columns or moving the calculation to Power Query.
Tips and Best Practices
- Align ranges: Always verify that every criteria_range is exactly the same size as max_range; mismatches are the most common source of #VALUE! errors.
- Use named ranges or structured tables for readability. With Excel Tables, the formula becomes
=MAXIFS(Table1[Revenue],Table1[Region],"North",Table1[Quarter],"Q1"), immediately understandable even months later. - For date criteria, store boundary dates in separate cells to avoid hard-coding, making the formula more flexible and less prone to regional date misinterpretation.
- Combine MAXIFS with dynamic dropdowns (Data Validation lists) for interactive dashboards where users can choose criteria and see the top value update instantly.
- Wrap array-based MAX/IF formulas in IFERROR to gracefully handle cases where no records meet the criteria:
=IFERROR(MAX(IF(...)),"No Match"). - When working with huge tables (100k+ rows), disable automatic calculation while building or debugging formulas, then press F9 to recalculate once you are done editing.
Common Mistakes to Avoid
- Range misalignment – copying a formula down but not updating absolute/relative references can cause criteria ranges to “shift”, returning incorrect maximums. Always anchor ranges with $ if they should remain fixed.
- Text-number mismatch – “105” stored as text will not match numeric 105. Use VALUE(), double-minus (--), or ensure consistent data types.
- Hidden spaces – “North ” with a trailing space fails a direct string comparison. Use TRIM on source data or compare with LEFT() if data is messy.
- Forgetting CSE in legacy array formulas – in Excel 2016 and older, pressing Enter alone returns #N/A or wrong answers. Remind users to confirm with Ctrl + Shift + Enter until they upgrade.
- Using volatile functions inside heavy calculations – TODAY(), RAND(), or OFFSET() recalculate constantly and can slow large MAXIFS formulas. Store their results in helper cells instead.
Alternative Methods
| Method | Pros | Cons | Best for |
|---|---|---|---|
| MAXIFS | Simple syntax, non-volatile, very fast | Requires Excel 2019 or 365 | Modern workbooks with up-to-date versions |
| Array MAX + IF | Works in any version since Excel 2007 | Harder to read, needs CSE on older Excel | Legacy environments |
| FILTER + MAX | Returns detailed rows, fully dynamic, LET-friendly | Requires dynamic array support, spills output | Dashboards needing both max and details |
| AGGREGATE | Ignores errors/hidden rows with option codes | Trickier arguments, limited to numeric ops | Datasets with hidden rows or #N/A errors |
| DMAX | Intuitive “database” feel, no array entry | Needs criteria range layout, limited flexibility | Users who prefer spreadsheet criteria blocks |
Use MAXIFS whenever available; fall back to array formulas when working in older versions or collaborating with users who cannot open 365 files.
FAQ
When should I use this approach?
Employ conditional maximum formulas any time you need the highest value that also meets several conditions—top regional sales, longest project delay by department, or highest temperature for a specific sensor and date range.
Can this work across multiple sheets?
Yes. Point criteria ranges to other worksheets by preceding the range with the sheet name, e.g., =MAXIFS(Sheet2!D2:D100,Sheet2!A2:A100,"North"). All referenced ranges still need identical dimensions.
What are the limitations?
MAXIFS cannot accept mixed data types in max_range. It also returns a single value—no tie handling—though FILTER + MAX circumvents this. Both MAXIFS and array formulas ignore logical conditions on non-numeric max_range values.
How do I handle errors?
Wrap the formula in IFERROR: =IFERROR(MAXIFS(...),"No Matching Data"). For array methods, handle possible division-by-zero or blank rows with the AGGREGATE function option code 6, which skips errors.
Does this work in older Excel versions?
Array formulas with MAX and IF work back to Excel 2007. MAXIFS and FILTER require Excel 2019 or Microsoft 365 (Win/Mac) and Excel for the web. Users opening the file in an older version will see #NAME? for unsupported functions.
What about performance with large datasets?
MAXIFS is optimized for speed. For datasets above about 200 000 rows, store data in an Excel Table, disable “Calculate on Save”, and consider indexing large ranges with helper columns. In extremely large models, offload to Power Pivot or Power Query.
Conclusion
Being able to calculate “the maximum if multiple criteria” is a versatile skill that lets you build faster reports, automate exception tracking, and deliver sharper insights without manual filtering. Whether you rely on MAXIFS, array formulas, or dynamic arrays, mastering these techniques deepens your overall Excel proficiency and prepares you for more advanced analytics tasks. Practice on your own data, experiment with alternative methods, and soon pulling the conditional maximum will become second nature—saving you time and elevating the accuracy of your work.
Related Articles
How to Show the 10 Most Common Text Values in Excel
Learn multiple Excel methods to list the 10 most frequent text values—complete with step-by-step examples, business use cases, and expert tips.
How to Abbreviate Names Or Words in Excel
Learn multiple Excel methods to abbreviate names or words with step-by-step examples and practical applications.
How to Abbreviate State Names in Excel
Learn multiple Excel methods to abbreviate state names with step-by-step examples, professional tips, and real-world applications.