max(
VALUE1
,
VALUE2
,
VALUE3
,
VALUE4
,
VALUE999
)

The max( function compares a series of values and returns the largest value.


Parameters

This function has five parameters:

value1 – The first text or numeric value (required).

value2 – The second text or numeric value (required).

value3 – The third text or numeric value (optional).

value4 – The fourth text or numeric value (optional).

value999 – The function allows an unlimited number of values.


Description

The max( function compares a series of values and determines the largest value. Although it states above that the function has five parameters, it actually has no limit - you can enter as many values as you like.

This example calculates the hottest city, LA or NY.

max(LosAngelesTemp,NewYorkTemp)

If you need to calculate the maximum of three or more values you can supply additional parameters like this.

max(LosAngelesTemp,NewYorkTemp,ChicagoTemp,SeattleTemp,DenverTemp)

You can use an unlimited number of parameters with this function.

In addition to numbers, the max( function can also be used with text values. However, you cannot mix text and numeric parameters – they must either be all numeric, or all text. (Of course you can convert numeric values to text with the str( or pattern( functions, or convert text to numbers with the val( function.

Here are some examples of the max( function in action:

max(5,3,7,9) ☞ 9
max(4,-7,23) ☞ 23☞ 
max("x","b","g") ☞ x
max(254,"zero") ☞ Error!

Error Messages

max( function must have at least two parameters – You’ll see this error message if you supply only one parameter, or no parameters at all.

max( function parameters must be either all text or all numbers. – You’ll see this error message if you mix text and numbers in the parameter list (for example min(3,“hello”).


See Also

  • min( -- compares a series of values and returns the smallest value.

History

VersionStatusNotes
10.0UpdatedCarried over from Panorama 6.0, but now allows an unlimited number of parameters (previously only allowed 2) and allows text as well as numeric values (but don't mix them in a single function).