*The tutorial explains the MAX function with many formula examples that show how to find highest value in Excel and highlight largest number in your worksheet.*

MAX is one of the most straightforward and easy-to-use Excel functions. However, it does have a couple of tricks knowing which will give you a big advantage. Say, how do you use the MAX function with conditions? Or how would you extract the absolute largest value? This tutorial provides more than one solution for these and other related tasks.

The MAX function in Excel returns the highest value in a set of data that you specify.

The syntax is as follows:

MAX(number1, [number2], …)

Where **number** can be represented by a numeric value, array, named range, a reference to a cell or range containing numbers.

*Number1* is required, *number2* and subsequent arguments are optional.

The MAX function is available in all versions of Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2010, Excel 2007, and lower.

To create a MAX formula in its simplest from, you can type numbers directly in the list of arguments, like this:

`=MAX(1, 2, 3)`

In practice, it's quite a rare case when numbers are "hardcoded". For the most part, you will deal with ranges and cells.

The fastest way to build a Max formula that finds the highest value in a range is this:

- In a cell, type
*=MAX(* - Select a range of numbers using the mouse.
- Type the closing parenthesis.
- Press the Enter key to complete your formula.

For example, to work out the largest value in the range A1:A6, the formula would go as follows:

`=MAX(A1:A6)`

If your numbers are in a **contiguous** row or column (like in this example), you can get Excel to make a Max formula for you automatically. Here's how:

- Select the cells with your numbers.
- On the
*Home*tab, in the*Formats*group, click*AutoSum*and pick**Max**from the drop-down list. (Or click*AutoSum*>*Max*on the*Formulas*tab in the*Function Library group.*)

This will insert a ready-to-use formula in a cell below the selected range, so please make sure there is at least one blank cell underneath the list of numbers that you've selected:

To successfully use Max formulas your worksheets, please remember these simple facts:

- In the current versions of Excel, a MAX formula can accept up to 255 arguments.
- If the arguments do not contain a single number, the MAX function returns zero.
- If the arguments contain one or more error values, an error is returned.
- Empty cells are ignored.
- Logical values and text representations of numbers supplied directly in the list of arguments are processed (TRUE evaluates as 1, FALSE evaluates as 0). In references, logical and text values are ignored.

Below you will find a few typical uses of the Excel MAX function. In many cases, there are a few different solutions for the same task, so I encourage you to test all the formulas to choose the one best suited for your data type.

To extract the largest number in a group of numbers, supply that group to the MAX function as a range reference. A range can contain as many rows and columns as you desire. For example, to get the highest value in the range C2:E7, use this simple formula:

`=MAX(C2:E7)`

To make a MAX formula for non-contiguous cells and ranges, you need to include a reference to each individual cell and/or range. The following steps will help you to do that quickly and flawlessly:

- Start typing a Max formula in a cell.
- After you've typed the opening parenthesis, hold down the Ctrl key and select the cells and ranges in the sheet.
- After selecting the last item, release Ctrl and type the closing parenthesis.
- Press Enter.

Excel will use an appropriate syntax automatically, and you will get a formula similar to this:

`=MAX(C5:E5, C9:E9)`

As shown in the screenshot below, the formula returns the maximum sub-total value from rows 5 and 9:

In the internal Excel system, dates are nothing else but serial numbers, so the MAX function handles them without a hitch.

For instance, to find the latest delivery date in C2:C7, make a usual Max formula that you'd use for numbers:

`=MAX(C2:C7)`

When you wish to get the maximum value based on conditions, there are several formulas for you to choose from. To make sure that all the formulas return the identical result, we will test them on the same set of data.

*The task*: With the items listed in B2:B15 and sales figures in C2:C15, we aim to find the highest sale for a specific item input in F1 (please see the screenshot at the end of this section).

If you a looking for a formula that works in all versions of Excel 2000 through Excel 2019, use the IF function to test the condition, and then pass the resulting array to the MAX function:

`=MAX(IF(B2:B15=F1, C2:C15))`

For the formula to work, it must press Ctrl + Shift + Enter simultaneously to enter it as an array formula. If all done correctly, Excel will enclose your formula in {curly braces}, which is a visual indication of an array formula.

It is also possible to evaluate several conditions in a single formula, and the following tutorial shows how: MAX IF with multiple conditions.

If you don't like using array formulas in your worksheets, then combine MAX with the SUMPRODUCT function that processes arrays natively:

`=SUMPRODUCT(MAX((B2:B15=F1)*(C2:C15)))`

For more information, please see MAX IF without array.

In Excel 2019 and Excel for Office 365, there is a special function named MAXIFS, which is designed to find the highest value with up to 126 criteria.

In our case, there is just one condition, so the formula is as simple as:

`=MAXIFS(C2:C15, B2:B15, F1)`

For the detailed explanation of the syntax, please see Excel MAXIFS with formula examples.

The below screenshot shows all 3 formulas in action:

This is, in fact, a variation of conditional MAX discussed in the previous example. To exclude zeros, use the "not equal to" logical operator and put the expression "<>0" in either the criteria of MAXIFS or the logical test of MAX IF.

As you understand, testing this condition only makes sense in case of **negative numbers**. With positive numbers, this check is superfluous because any positive number is greater than zero.

To give it a try, let's find the lowest discount in the range C2:C7. As all the discounts are represented by negative numbers, the smallest discount is actually the largest value.

Be sure to press Ctrl + Shift + Enter to correctly complete this array formula:

`=MAX(IF(C2:C7<>0, C2:C7))`

It's a regular formula, and a usual Enter keystroke will suffice.

`=MAXIFS(C2:C7,C2:C7,"<>0")`

When you work with a large amount of data driven by various formulas, chances are that some of your formulas will result in errors, which will cause a MAX formula to return an error too.

As a workaround, you can use MAX IF together with ISERROR. Given that you are searching in the range A1:B5, the formula takes this shape:

`=MAX(IF(ISERROR(A1:B5)), "", A1:B5))`

To simplify the formula, use the IFERROR function instead of the IF ISERROR combination. This will also make the logic a bit more obvious – if there's an error in A1:B5, replace it with an empty string (''), and then get the maximum value in the range:

`=MAX(IFERROR(A1:B5, ""))`

A fly in the ointment is that you need to remember to press Ctrl + Shift + Enter because this only works as an array formula.

In Excel 2019 and Excel for Office 356, the MAXIFS function can be a solution, provided that your data set contains at least one positive number or zero value:

`=MAXIFS(A1:B5,A1:B5,">=0")`

Since the formula searches for the highest value with the condition "greater than or equal to 0", it won't work for a data set consisting of solely negative numbers.

All these limitations are not good, and we are evidently in need of a better solution. The AGGREGATE function, which can perform a number of operations and ignore error values, fits perfectly:

`=AGGREGATE(4, 6, A1:B5)`

The number 4 in the 1st argument indicates the MAX function, the number 6 in the 2nd argument is the "ignore errors" option, and A1:B5 is your target range.

Under perfect circumstances, all three formulas will return the same result:

When working with a range of positive and negative numbers, sometimes you may wish to find the largest absolute value regardless of the sign.

The first idea that comes to mind is to get the absolutes values of all numbers in the range by using the ABS function and feed those to MAX:

{=MAX(ABS(*range*))}

This is an array formula, so don't forget to confirm it with the Ctrl + Shift + Enter shortcut. Another caveat is that it only works with numbers and results in an error in case of non-numeric data.

Not happy with this formula? Then let us build something more viable :)

What if we find the minimum value, reverse or ignore its sign, and then evaluate along with all other numbers? Yep, that will work perfectly as a normal formula. As an extra bonus, it handles text entries and errors just fine:

With the source numbers in A1:B5, the formulas go as follows.

**Array** formula (completed with Ctrl + Shift + Enter):

`=MAX(ABS(A1:B5))`

**Regular** formula (completed with Enter):

`=MAX(MAX(A1:B5), -MIN(A1:B5))`

or

`=MAX(MAX(A1:B5), ABS(MIN(A1:B5)))`

The below screenshot shows the results:

In some situations, you may have a need to find the largest absolute value but return the number with its original sign, not the absolute value.

Assuming the numbers are in cells A1:B5, here's the formula to use:

`=IF(ABS(MAX(A1:B5))>ABS(MIN(A1:B5)), MAX(A1:B5), MIN(A1:B5))`

Complex at first sight, the logic is quite easy to follow. First, you find the largest and smallest numbers in the range and compare their absolute values. If the absolute max value is greater than the absolute min value, the maximum number is returned, otherwise – the minimum number. Because the formula returns the original and not absolute value, it keeps the sign information:

In situation when you want to identify the largest number in the original data set, the fastest way is to highlight it with Excel conditional formatting. The below examples will walk you through two different scenarios.

Microsoft Excel has a predefined rule to format top ranked values, which suits our needs perfectly. Here are the steps to apply it:

- Select your range of numbers (C2:C7 in our case).
- On the
*Home*tab, in the*Styles*group, click*Conditional formatting > New Rule*. - In the
*New Formatting Rule*dialog box, choose**Format only top or bottom ranked values**. - In the lower pane, pick
**Top**from the drop-down list and type 1 in the box next to it (meaning you want to highlight just one cell containing the largest value). - Click the
*Format*button and select the desired format. - Click OK twice to close both windows.

Done! The highest value in the selected range is automatically highlighted. If there is more than one max value (duplicates), Excel will highlight them all:

Since there is no built-in rule to make the highest value stand out from each row, you will have to configure your own one based on a MAX formula. Here's how:

- Select all the rows in which you want to highlight max values (C2:C7 in this example).
- On the
*Home*tab, in the*Styles*group, click*New Rule*>*Use a formula to determine which cells to format*. - In the
*Format values where this formula is true*box, enter this formula:`=C2=MAX($C2:$E2)`

Where C2 is the leftmost cell and $C2:$E2 is the first row range. For the rule to work, be sure to lock the column coordinates in the range with the $ sign.

- Click the
*Format*button and choose the format you want. - Click OK twice.

`=C2=MAX(C$2:C$7)`

For more information, please see How to create a formula-based conditional formatting rule.

MAX is one of the most straightforward Excel functions to use. If against all expectations it does not work right, it's most likely to be one of the following issues.

If a normal MAX formula returns 0 even though there are higher numbers in the specified range, chances are those numbers are formatted as text. It's especially the case when you run the MAX function on data driven by other formulas. You can check this by using the ISNUMBER function, for example:

`=ISNUMBER(A1)`

If the above formula returns FALSE, the value in A1 is not numeric. Meaning, you should troubleshoot the original data, not a MAX formula.

Please check the referenced cells carefully. If any of the referenced cells contains an error, a MAX formula will result in the same error. To bypass this, see how to get the max value ignoring all errors.

That's how to find max value in Excel. I thank you for reading and hope to see you on our blog soon!

Excel formulas
CSV
Excel functions
Print
Financial functions
Vlookup
Merge data in Excel
SumIf
CountIf
Excel Compare
If statement
Excel Charts
Pivot Table
Conditional formatting
Excel formatting
Excel duplicates
Excel date
Excel tips
Excel macro
Outlook
Google Sheets
Outlook duplicates
Shared email templates

Category: Excel Tips

60+ professional tools for Excel

2019–2010 to do your daily work

2019–2010 to do your daily work

Incredible product, even better tech support…AbleBits totally delivers!

Deborah Bryant

Anyone who works with Excel is sure to find their work made easier

Jackie Lee

The best spent money on software I've ever spent!

Patrick Raugh

Ablebits is a fantastic product - easy to use and so efficient.

Debra Celmer

Excel is at its best now

Annie C.

I don't know how to thank you enough for your Excel add-ins

Jennifer Morningstar

Anybody who experiences it, is bound to love it!

Kumar Nepa

AbleBits suite has really helped me when I was in a crunch!

Nelda Fink

I have enjoyed every bit of it and time am using it

Christian Onyekachi Nwosu

It's the best $100 we've ever spent!

Mike Cavanagh

I love the program, and I can't imagine using Excel without it!

Robert Madsen

One word… WOW!

Dave Brown

Love the products!

David Johnston

It is like having an expert at my shoulder helping me…

Linda Shakespeare

Your software really helps make my job easier

Jeannie C.

Thanks for a terrific product that is worth every single cent!

Dianne Young

I love your product

Brad Gibson

Awesome!!!

Sheila Blanchard

## 30 responses to "MAX function in Excel: formula examples to find and highlight highest value"

Well nd easy

How to find max, 2nd, 3rd & 4th latest dates by name in another sheet?

Results e;

Names in column A

Dates in column B

Distance in column C

& so on

Regards

Tony

THANK YOU!!! Do you know how complicated I have been making this for years?! And it was as simple as =Max!!!

You have made my day!

which one of the following functions is designed to display the maximum value in a range of cells with question answer

This is excellent, thanks for saving me a ton of time!

Dear Sir

can you help me to do a formula to find highest value of 1st numbers letters

Hi, is it possible to create a formula to find the max value if some of the cells contain ranges please?

i.e. working out that the max value is 505 from the following cells:

Cell 1. 490

Cell 2. 500,

Cell 3. 490-505

I am trying to find a formula that returns for example to find which State had the highest sales for a specific month. Column A is the State and Column B is the sales for the specific month. Does anyone know a formula for this? Thanks.

Hello!

The formula below will do the trick for you:

=INDEX(A1:A50,MATCH(MAX(B1:B50),B1:B50,0))

Here is the article that may be helpful to you: INDEX function in Excel

Thanks it worked.

Well if my range is - A2:D10 and I need to find the highest value with the name the person

Hi!

Please describe your problem in more detail. Include an example of the source data and the result you want to get.

I'm struggling with this a bit.

My challenge is that I've got a list of results in a column, and want to identify the largest value in that column and then add a bonus prize in the next column for the largest row value.

I would describe it BADLY as:

in the column next to the data: +IF("the data in this cell is greater than the cells in rh column, give me A point" otherwise 0)

Does that make sense?

thanks

Hello!

In the next column, you can write the formula

=IF(MAX($A$1:$A$30)=A1,100,"")

After that you can copy this formula down along the column.

Hope this is what you need.

hello

Can I get help to write a formula that will highlight the lowest price for an article that repeats in several rows. If that article only shows once then that price would be highlighted too. for example only the first line would be highlighted.

article 1 300

article 1 548

article 1 2500

Thank you for your help

Hello!

I recommend using the FILTER function to find the article you are looking for. Find the minimum price using the MAXIFS function.

=FILTER(A1:B8,(A1:A8="article 1")*(B1:B8=MINIFS(B1:B8,A1:A8,A1:A8)))

I hope my advice will help you solve your task.

Hello, I'm trying to get the maximum error to show up but some times the maximum error is a negative (so -5 is a greater error than +3 etc) Any ideas?

Also the 2 cells I'm comparing arent next to each other (just to add to the fun).

Hello!

The information you provided is not enough to understand your case and give you any advice. Write an example of the source data and the result you want to get.

Hi, I am involved in stock trading and i have my trading records in Excel; ie bunch of profits and losses.

My question is, how do i find the lowest and highest profit and loss that i make in my records?

=MAX(IFERROR(P23:P79, "")) + CTRL + Shift + Enter only return highest profit, while

=MIN(IFERROR(P23:P79, "")) + CTRL + Shift + Enter returns highest loss.

How do i find lowest profit and lowest loss? Where can i fit the criteria "0" ?

Do note that i have multiple blanks (intentionally left) and #DIV/0! (formula i keyed in in advance for future trading but i havent filled in respective fields)

Thank you in advance. God bless and have a nice day.

Hello!

To find the lowest loss, use the formula

=MAXIFS(A1:A10,A1:A10," < 0")

Minimum profit -

=MINIFS(A1:A10,A1:A10," > 0")

Please have a look at this article: MINIFS function in Microsoft Excel and MAXIFS function in Excel.

Hi,

I have a data sheet that I need to extract information from, in one column I have the NAMES of persons, in another I have either "yes" or "no" answers for each person.

I'd like to extract everyone's name who answered "yes" into either one cell, separated by commas, or each into a vertical list.

Hello!

I recommend reading this guide: Excel FILTER function - dynamic filtering with formulas.

I hope I answered your question. If something is still unclear, please feel free to ask.

Hello,

Does anyone know how to apply this function with data that is not in a consecutive range?

Instead of a range like B5:G5, my data is B5,D5,F5,

Can anyone help?

Thanks!

Hi!

You can use this formula:

=MAX(B5,D5,F5)

Hi

Am working with data where I have to get the date of Highest Quantity with matching Product No.

Maxif formula is not working with.

Kindly suggest the way out.

Product Qty Date

GHI 102 30-Aug

DEF 77 30-Aug

ABC 21 30-Aug

ABC 10 30-Aug

GHI 119 20-May

GHI 106 20-May

GHI 94 20-May

DEF 81 20-May

DEF 69 20-May

DEF 56 20-May

ABC 44 20-May

ABC 36 20-May

ABC 10 20-May

GHI 114 10-May

DEF 90 10-May

DEF 65 10-May

ABC 40 10-May

ABC 20 10-May

GHI 110 01-May

DEF 85 01-May

DEF 61 01-May

ABC 35 01-May

GHI 123 30-Apr

GHI 98 10-Apr

DEF 73 10-Apr

ABC 48 10-Apr

ABC 30 10-Apr

Result should be - ABC - 10-Apr (ABC highest Qty is 48 so 10-Apr)

Hello!

Specify which formula you are using. Also, check if your date is written as text.

Hi

Date format is correct.

Have tried {=MAX(IF($B$3:$B$29=$G6,$D$3:$D$29))}

This gives me latest date against ABC which is 30-Aug.

I would like to have result 10-Apr because ABC has 48 (highest Value)

Hello!

I believe the following formula will help you solve your task:

=FILTER($D$3:$D$29,($B$3:$B$29=$G$6)*($C$3:$C$29=MAXIFS($C$3:$C$29,$B$3:$B$29,$G$6)))

You can learn more about FILTER function in Excel in this article on our blog.

Hi,

Could you please help me out on how to calculate max time from an array of 3 time stamps of 3 systems placed horizontal in range? How can I get the system names too after I try the formula or it can directly show system names that has highest time? How can I use maxifs with criteria range?

System 1, 00:30:23

System 2, 00:57:20

System 3, 00:11:05

Hello!

If I understand your task correctly, the following formula should work for you:

=INDEX(A1:A10,MATCH(MAX(B1:B10),B1:B10,0))