Excel Find Greatest Value: MAX and MAXIFS Guide
In this article
To find the greatest value in Excel, use the MAX function for a simple range: type =MAX(A1:A10) and press Enter. For the largest value that meets one or more conditions, use MAXIFS in Excel 2019, Excel 2021 and Microsoft 365, or the array formula MAX(IF(...)) in older versions. Both return the highest number, not text or blanks.
What You'll Need
- Excel 2016 or later (MAX works in all versions; MAXIFS requires Excel 2019, Excel 2021, or Microsoft 365 on Windows or Mac).
- A range of numeric data with a header row if you plan to use criteria.
- Basic familiarity with cell references and the formula bar.
Step-by-Step
- Select the cell where you want the result. Click an empty cell, for example E2, so the answer does not overwrite your data.
- Start the formula with =MAX(. Type
=MAX(directly in the cell or in the formula bar. Excel will show a tooltip listing the arguments. - Highlight the range of numbers. Drag over the cells, for example A2:A100, or type the range. Close the parenthesis and press Enter. The cell now shows the largest number in that range.
- Check that the range contains only numbers. MAX ignores text, blanks and logical values in referenced cells. If the result looks wrong, confirm there are no numbers stored as text (they appear left-aligned by default).
- For a conditional maximum, use MAXIFS. The syntax is
=MAXIFS(max_range, criteria_range1, criteria1, ...). For example,=MAXIFS(B2:B100, A2:A100, "North")returns the largest value in B2:B100 where column A equals North. - Add more criteria if needed. Continue with additional range/criterion pairs:
=MAXIFS(B2:B100, A2:A100, "North", C2:C100, ">100"). Each pair must have the same number of rows and columns as max_range. - Use wildcards for text criteria. In MAXIFS, ? matches one character and * matches any sequence. For example,
"North*"matches North, Northeast, etc. Wildcards work for text, not for numbers. - For older Excel versions without MAXIFS, use an array formula. Type
=MAX(IF(A2:A100="North", B2:B100))and press Ctrl+Shift+Enter (Cmd+Shift+Enter on Mac) so Excel wraps it in braces. In Microsoft 365, Enter alone works because of dynamic arrays. - Find the position of the maximum if you need it. Use
=MATCH(MAX(A1:A10), A1:A10, 0)to get the relative row number, or combine with INDEX to return a label from another column. - Press Enter and verify the result. Compare against a manual sort (Data > Sort Largest to Smallest) to confirm the formula is picking up the right range.
Menu labels and function availability can differ slightly by Excel version, platform and region. MAXIFS is not available in Excel 2016 or earlier, and it is not supported in Excel for the web in some older tenants; if you do not see it, use the array formula in step 8.
Common Mistakes
- Including the header row. MAX ignores text, so a header usually does no harm, but MAXIFS can return #VALUE! if the criteria range includes text where numbers are expected. Use exact data ranges.
- Numbers stored as text. Values imported from CSV or copied from web pages may be left-aligned text. MAX skips them, giving a lower result than expected. Fix with Text to Columns or multiply by 1.
- Mismatched range sizes in MAXIFS. max_range and every criteria_range must be the same size. A one-row difference returns #VALUE!.
- Forgetting Ctrl+Shift+Enter in older Excel. A plain Enter on the MAX(IF(...)) formula returns an error or the wrong value in Excel 2016 and earlier.
- Using MAXA by accident. MAXA counts logical values and text representations of numbers, which can inflate the result. Use MAX for pure numbers.
Tips
- Name your ranges (Formulas > Define Name) so formulas read as
=MAX(Sales)instead of cell addresses. - Use
=MAX(IF(ISNUMBER(A1:A10), A1:A10))as an array formula to ignore text entries entirely. - To find the largest value in a filtered list only, use the SUBTOTAL function with function number 104:
=SUBTOTAL(104, A1:A10)ignores hidden rows. - Combine MAX with conditional formatting to highlight the top value automatically: Home > Conditional Formatting > Top/Bottom Rules > Top 10 Items, set to 1.
- For a quick visual check, select the range and look at the status bar; Excel shows Average, Count and Sum by default, and you can right-click the status bar to enable Maximum.
Troubleshooting
- Formula returns 0. The range may contain no numbers, or all numbers are stored as text. Check alignment and use VALUE or Text to Columns to convert.
- #VALUE! error in MAXIFS. Usually a range size mismatch or a criteria range that includes text where numbers are compared. Verify each range has identical dimensions.
- #NAME? error. MAXIFS is not available in your Excel version. Use the array formula from step 8, or update to Microsoft 365.
- Wrong maximum after adding rows. The formula range may not include the new rows. Convert the data to an Excel Table (Insert > Table) and reference the table column, e.g.
=MAX(Table1[Sales]), so the range expands automatically. - Array formula returns #VALUE!. Confirm you pressed Ctrl+Shift+Enter in older Excel, and that the IF ranges are the same size.
Frequently Asked Questions
What is the difference between MAX and MAXA?
MAX ignores logical values and text in referenced cells. MAXA treats TRUE as 1, FALSE as 0, and text representations of numbers as numbers, so it can return a different (often higher) result.
Can MAX return the largest text value alphabetically?
No. MAX works on numbers only. To find the last item alphabetically, use =INDEX(A1:A10, MATCH(MAX(COUNTIF(A1:A10, "<"&A1:A10)), COUNTIF(A1:A10, "<"&A1:A10), 0)) as an array formula, or sort the column Z to A.
Why does MAXIFS return #VALUE! when my criteria look correct?
The most common cause is that max_range and criteria_range are different sizes, or a criteria range contains text where a numeric comparison is made. Make all ranges identical in rows and columns.
Does MAX work across multiple sheets?
Yes. Use a 3D reference such as =MAX(Sheet1:Sheet3!A1:A10) to return the largest value across the same range on several sheets.
How do I find the second largest value?
Use the LARGE function: =LARGE(A1:A10, 2) returns the second largest, =LARGE(A1:A10, 3) the third, and so on.
Can I use MAX with dates?
Yes. Excel stores dates as numbers, so =MAX(A1:A10) returns the latest date. Format the result cell as a date (Home > Number Format > Short Date) to display it correctly.