MAX function

This article describes the formula syntax and usage of the MAX function in Microsoft Excel.

Description

Returns the largest value in a set of values.

Syntax

MAX(number1, [number2], ...)

The MAX function syntax has the following arguments:

  • Number1, number2, ...    Number1 is required, subsequent numbers are optional. 1 to 255 numbers for which you want to find the maximum value.

Remarks

  • Arguments can either be numbers or names, arrays, or references that contain numbers.

  • Logical values and text representations of numbers that you type directly into the list of arguments are counted.

  • If an argument is an array or reference, only numbers in that array or reference are used. Empty cells, logical values, or text in the array or reference are ignored.

  • If the arguments contain no numbers, MAX returns 0 (zero).

  • Arguments that are error values or text that cannot be translated into numbers cause errors.

  • If you want to include logical values and text representations of numbers in a reference as part of the calculation, use the MAXA function.

Example

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Data

10

7

9

27

2

Formula

Description

Result

=MAX(A2:A6)

Largest value in the range A2:A6.

27

=MAX(A2:A6, 30)

Largest value in the range A2:A6 and the value 30.

30

Applies To: Excel 2013, Excel 2007, Excel 2010, Excel Starter, Excel Online, Excel 2016 for Mac



Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language