BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
adampaulsmith

Community Trekker

Joined:

Sep 17, 2012

How to create a formula column to find the maximum of several columns

I have several columns of numeric data (see example below) and I would like to create a formula column to find the maximum value for each row across the columns.  Any help would be appreciated.  Thank you!

Value 1      Value 2      Value 3      Max Value (I would put the formula in this column)

1                    9               6                    9

2                    1               5                    5

3                    7               4                    7

4                    2               6                    6

1 ACCEPTED SOLUTION

Accepted Solutions
pmroz

Super User

Joined:

Jun 23, 2011

Solution

Re: How to create a formula column to find the maximum of several columns

The Maximum() function will do this for you.

 

Maximum(:Value 1, :Value 2, :Value 3)
4 REPLIES 4
pmroz

Super User

Joined:

Jun 23, 2011

Solution

Re: How to create a formula column to find the maximum of several columns

The Maximum() function will do this for you.

 

Maximum(:Value 1, :Value 2, :Value 3)
adampaulsmith

Community Trekker

Joined:

Sep 17, 2012

Re: How to create a formula column to find the maximum of several columns

Thanks ! I knew it had to be something simple.

NDENNIS418

New Contributor

Joined:

Mar 27, 2019

Re: How to create a formula column to find the maximum of several columns

If you have many rows which you want to search, is there a function to select a range of rows as opposed to typing in every row into the function?

txnelson

Super User

Joined:

Jun 22, 2012

Re: How to create a formula column to find the maximum of several columns

The question asked by @adampaulsmith and answered by @pmroz uses the Maximum() function in a formula define for the resulting column.  The formula will automatically loop across each row and apply the formula.  Thus, no row reference has to be made.

However, if you are using this in open JSL, you can add a subscript to the column references to indicate which row you process.

For( theRow = 1, theRow <= 10, theRow++,
     :MaxValue[theRow] = Maximum( :Value 1[theRow], :Value 2[theRow], :Value 2[theRow] );
);

See documentation on JSL in the Scripting Guide

     Help==>Books==>Scripting Guide 

Jim