How to Maxifs Function in Excel
Learn multiple Excel methods to Maxifs Function with step-by-step examples and practical applications.
How to Maxifs Function in Excel
Why This Task Matters in Excel
Successful analysts and managers do not simply look for the largest number in a column; they want the largest number that meets very specific business conditions. “What was the highest sale in the West region this quarter?” “Which product generated the highest margin for online orders?” “Which employee logged the most overtime during night shifts?” These questions all require a “conditional maximum.” If you do not know how to calculate a conditional maximum quickly, you end up with slow, error-prone manual methods such as filtering, sorting, or pivot tables that must be rebuilt each time the data updates.
Mastering a robust way to return a maximum with criteria is crucial in many industries. Retailers use it to spot the highest-selling SKU in each store. Finance teams rely on it to find the largest expense in a category for audit purposes. Logistics managers track the longest transit time within a lane to identify bottlenecks. In every case, the analyst must isolate the correct subset of data before evaluating the maximum value.
Excel shines here for several reasons. First, it stores large volumes of structured data that update daily. Second, its formula engine recalculates instantly, letting you build dynamic dashboards that highlight the current “top performer” according to any combination of filters. Finally, Excel offers native functions—especially MAXIFS in Microsoft 365 / Excel 2019 onward—that make the logic almost conversational.
Not knowing how to calculate a conditional maximum leads to bad decisions. Users may overlook critical outliers, misallocate resources, or waste hours on manual checks. Additionally, conditional maximums dovetail with other core Excel skills such as dynamic reports, data validation, conditional formatting, and trend analysis. Learning to “Maxifs” both deepens your formula toolbox and speeds up downstream reporting tasks.
Best Excel Approach
The most powerful and readable method is the MAXIFS function, introduced in Excel 2019 and available in Microsoft 365. MAXIFS behaves like a SUMIFS or AVERAGEIFS but returns the largest value that satisfies one or more criteria, eliminating the need for array formulas.
When to use MAXIFS:
- Your workbook is saved in Excel 2019 or Microsoft 365
- You need a live result that recalculates as new rows are added
- You must apply up to 126 criteria pairs (rarely needed but good to know)
When to consider alternatives (covered later):
- Colleagues are on Excel 2016 or earlier and cannot use MAXIFS
- You require case-sensitive text matching (MAXIFS is not case-sensitive)
- You are performing a complicated tie-breaking rule that MAXIFS cannot express
Logic overview: MAXIFS scans a “max range” and, row by row, checks whether each row matches all supplied criteria. If a row passes every test, the numeric value from the max range joins a hidden list. After scanning, the function returns the largest value in that hidden list.
Syntax:
=MAXIFS(max_range, criteria_range1, criteria1, [criteria_range2, criteria2], …)
- max_range – The numeric cells from which you want the maximum.
- criteria_range1 – The first range to test.
- criteria1 – The condition to apply to criteria_range1.
- Additional pairs – Optional; each additional criteria_range must align in size and shape with the max_range.
Alternative for older versions:
=MAX(IF(criteria_range1=criteria1, max_range))
This legacy array formula (entered with Ctrl + Shift + Enter in Excel 2016 or earlier) replicates MAXIFS but at the cost of readability and potential performance issues.
Parameters and Inputs
-
max_range (required)
- Must be numeric. Blank cells are ignored. Non-numeric text triggers a #VALUE! error.
- Size and shape must match every criteria_range.
-
criteria_range1 (required)
- Typically text, date, or numeric values to be tested.
- Must be exactly the same length and orientation as max_range.
-
criteria1 (required)
- Can be a value (\"West\"), an operator-value pair (\">=01-Jan-2024\"), or a cell reference that stores the condition.
- Text conditions are not case-sensitive. Wildcards (* ?) are allowed.
-
[criteria_range2, criteria2] … up to 126 pairs (optional)
- Same alignment rules apply.
- Each pair is “AND”-combined; all must be satisfied.
Data preparation tips:
- Store dates as real date serials, not text.
- Trim spaces from text fields to avoid mismatches.
- Remove non-numeric symbols (like $) in max_range; apply currency formatting instead.
- Validate ranges with COUNTA and COUNT functions to ensure equal row counts.
- For dynamic tables, convert your source data to an Excel Table so ranges expand automatically.
Edge cases:
- If no row meets all criteria, MAXIFS returns 0, not an error. Use IFERROR to convert 0 to a custom message if 0 is a legitimate data point.
- If any criteria_range contains errors (e.g., #N/A), MAXIFS returns #VALUE!. Clean data beforehand.
Step-by-Step Examples
Example 1: Basic Scenario – Highest Regional Sale
Suppose you manage quarterly sales data in [A1:C17]:
- Column A – Region
- Column B – Sales Rep
- Column C – Amount
Goal: find the highest sale in the “West” region.
Step 1 – Enter sample data
In [A2:A17] list \"North\", \"South\", \"East\", \"West\" randomly. Fill [C2:C17] with sales values such as 12000, 18500, 22250, etc.
Step 2 – Add a cell for the region filter
Cell [E2] = \"West\" (user input).
Step 3 – Enter MAXIFS
In [F2] type:
=MAXIFS(C2:C17, A2:A17, E2)
Because max_range [C2:C17] aligns with criteria_range [A2:A17], the function evaluates each row. Only rows where Region equals \"West\" are considered. The formula instantly returns, for example, 25 600 – the highest West sale.
Why it works: MAXIFS builds an invisible array of qualifying amounts [15 500, 20 700, 25 600] and applies MAX to that subset.
Variations:
- Replace E2 with a data validation drop-down to let users pick any region.
- Add a second criterion for Quarter by including criteria_range2 [D2:D17] and criteria2 \"Q1\".
Troubleshooting:
- If the result is 0 verify that “West” is spelled consistently and without trailing spaces.
- If you see #VALUE!, confirm that [C] contains only numbers.
Example 2: Real-World Application – Maximum Profit by Product and Sales Channel
Assume a retail dataset with 5 000 rows stored in an Excel Table named tblSales containing:
- Date
- Product
- Channel (Online, Store, Wholesale)
- Profit
Business question: What is the biggest single-sale profit for “Coffee Beans” sold Online during the current month?
Step 1 – Capture dynamic criteria
Cell [G2] = \"Coffee Beans\"
Cell [G3] = \"Online\"
Cell [G4] = EOMONTH(TODAY(),0) to store last calendar day of the current month.
Cell [G5] = EOMONTH(TODAY(),−1)+1 to store first day of the month.
Step 2 – Build the formula
=MAXIFS(tblSales[Profit],
tblSales[Product], G2,
tblSales[Channel], G3,
tblSales[Date], ">="&G5,
tblSales[Date], "<="&G4)
Explanation:
- The paired date conditions restrict the scan to transactions from this month only.
- The “AND” logic means a row must match product, channel, and date boundaries before its Profit is considered.
- Because the table object automatically expands, future sales will recalibrate the result without editing the formula.
Business impact: A category manager can paste the formula on a dashboard; the figure updates each morning, highlighting record-breaking profits in real time. This can trigger marketing actions such as promoting inventory or investigating anomalies if the number spikes unusually high.
Integration note: You can tie this MAXIFS output to conditional formatting or Power Query refresh routines. Using a named table keeps calculation time low even with thousands of rows.
Performance considerations: MAXIFS is internally optimized for multiple criteria ranges and beats equivalent array formulas by a significant margin on large datasets. You still benefit from turning off “Automatic except data tables” calculation during heavy import operations to reduce recalculation overhead.
Example 3: Advanced Technique – Emulating MAXIFS in Older Excel Versions
Your organization still runs Excel 2013, which lacks MAXIFS. You need the largest score by Department “R&D” where Status equals “Completed.” Data lies in [A2:C20000] with columns Department, Status, Score.
Step 1 – Create a compatibility formula
Enter in [E2]:
=MAX(IF((A2:A20000="R&D")*(B2:B20000="Completed"), C2:C20000))
Important: In Excel 2013 press Ctrl + Shift + Enter, turning it into an array formula. Newer Excel shows a spill border automatically.
Logic breakdown:
- (A2:A\20000=\"R&D\") returns an array of TRUE/FALSE.
- Multiplying by (B2:B\20000=\"Completed\") converts them to 1 and 0, effectively “AND”-ing the conditions.
- IF keeps values from C only where the product equals 1.
- MAX evaluates the resulting list.
Edge cases handled: If no row meets criteria, the formula returns 0; wrap with IFERROR for a blank.
Optimizations:
- Replace direct string literals with cell references to avoid editing the formula each time.
- Limit ranges with dynamic named ranges or convert to a table if row count will grow.
- In extremely large sheets consider the AGGREGATE function with row numbers to bypass array entry, but that method is more complex.
Professional tip: Encourage transitioning to Microsoft 365 to unlock MAXIFS and other dynamic array features, which remove the Ctrl + Shift + Enter burden and reduce memory usage.
Tips and Best Practices
- Convert source data to an Excel Table and reference structured names (tblSales[Profit]) so MAXIFS expands automatically.
- Store criteria in dedicated input cells; reference those cells in formulas to make dashboards self-service and to avoid editing formulas.
- Combine MAXIFS with IFERROR to display “No Match” if the result equals 0 yet zero is not a valid outcome.
- Use wildcards in criteria (e.g., \"West*\") to aggregate sub-regions without extra columns.
- For multi-year reporting, add a “Year” helper column rather than stacking complex date logic in the formula, improving readability.
- If you need case-sensitive matching, create a helper column that enforces case or switch to an array formula using EXACT.
Common Mistakes to Avoid
- Mismatched range sizes: If max_range has 500 rows but criteria_range only 499, MAXIFS returns #VALUE!. Always check row counts with ROWS or COUNTA.
- Quoting numeric criteria incorrectly: Writing \">5\" without quotes leads to Name? errors; always wrap operator-numeric pairs in quotes or use cell references.
- Expecting MAXIFS to ignore hidden rows: Filtering hides rows but MAXIFS still evaluates them. Apply a filter criterion in the formula itself or use SUBTOTAL with AGGREGATE.
- Overlooking text vs number storage: A “100” stored as text in max_range is ignored. Convert text numbers with VALUE or paste special – values.
- Forgetting wildcard behaviour: \"??\" matches exactly two characters, not “contains two any characters anywhere.” Misusing wildcards returns unintended matches; test with COUNTIFS first.
Alternative Methods
| Method | Excel Version | Ease of Use | Performance | Supports Many Criteria | Case-Sensitive Option |
|---|---|---|---|---|---|
| MAXIFS | 2019 / 365 | Very easy | Excellent | Up to 126 | No |
| Array with MAX(IF()) | 2007-365 | Medium | Good on small data, slower on large | Unlimited | Yes (with EXACT) |
| Pivot Table + Filter | All | Very easy | Excellent after refresh | Limited to “Report Filters” | No |
| AGGREGATE with ROW helper | 2010-365 | Hard | Excellent | Good | No |
When to use each:
- Choose MAXIFS whenever available for clarity and speed.
- Use the array alternative when colleagues still rely on earlier Excel versions.
- Rely on a Pivot Table for quick ad-hoc exploration or when you prefer a drag-and-drop interface rather than formulas.
- AGGREGATE shines when you need to exclude hidden rows or handle errors gracefully, but it requires a helper column and deeper formula skills.
Compatibility: Mac Excel 2019 includes MAXIFS; Excel Online does as well. Google Sheets uses MAXIFS with identical syntax, easing cross-platform sharing.
Migration tip: Convert existing array formulas to MAXIFS when upgrading by replacing the outer MAX(IF(…)) pattern with MAXIFS and removing Ctrl + Shift + Enter. Test results in a copy of the workbook first to confirm parity.
FAQ
When should I use this approach?
Use MAXIFS whenever you need a live maximum value constrained by one or more filters and you have Excel 2019 or later. It is ideal for dashboards, KPI trackers, and any dataset that grows over time.
Can this work across multiple sheets?
Yes. Qualify each range with its sheet name, for example =MAXIFS(Sales!C:C, Sales!A:A, "West"). All criteria ranges must reside in the same worksheet as the max_range. If you need cross-sheet criteria, gather the data first into a single helper column or use Power Query to combine tables.
What are the limitations?
MAXIFS is not case-sensitive, returns 0 instead of an error when no rows match, and cannot perform OR logic within the same criteria pair (you must supply separate pairs or helper columns). Excel caps the criteria pairs at 126, but practical performance limits are reached well before that.
How do I handle errors?
Wrap your formula with IFERROR or LET. Example: =IFERROR(MAXIFS(…), "No Match"). Alternatively, cleanse data with ISNUMBER, NA(), or Power Query before it reaches the formula layer.
Does this work in older Excel versions?
MAXIFS is unavailable in Excel 2016 and earlier. Use the array formula MAX(IF(…)), pivot tables, or upgrade. Office 2019 perpetual includes MAXIFS, as does every Microsoft 365 subscription.
What about performance with large datasets?
MAXIFS is highly optimized. Still, keep ranges restricted to the used rows rather than full columns. Turn your dataset into a Table so the range remains dynamic without scanning thousands of empty cells. Consider manual calculation mode during massive data imports and avoid volatile functions referencing the same ranges.
Conclusion
Being able to calculate “the largest value that meets my criteria” is a line-of-business superpower. With MAXIFS, Excel users can build dynamic, self-updating reports that surface peak performance in seconds rather than minutes. Mastery of this task streamlines decision-making, complements other analytics techniques such as SUMIFS or AVERAGEIFS, and positions you to tackle more advanced modeling topics like dynamic arrays, LET, and LAMBDA. Take the time to practise each example, convert legacy array formulas where possible, and you will elevate both the accuracy and efficiency of your spreadsheets.
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.