cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

Discussions

Solve problems, and share tips and tricks with other JMP users.
aadecarlojr
Level III

formula to provide greatest numerical value from multiple columns

I have two related columns with numerical values and I cannot figure out how to create a formula column that delivers the maximal value of the two input columns. Everything I try ends up with an "else" in the formula and I don't think I want that.

 

thanks if you know how.

 

Dr. DeCarlo

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Perkinson
Community Manager Community Manager

Re: formula to provide greatest numerical value from multiple columns

It's not clear exactly what you want, @aadecarlojr.

 

If you want the maximum value across all the values of the two given columns then the JSL that @txnelson gave above will work.

 

If, on the other hand, you want something like this:

 

A

B

Max of A and B

1

2

2

4

3

4

8

7

8

Then the formula:

 

Maximum(:A, :B)

will give you that.

2022-08-15_15-26-54.698.png

-Jeff

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: formula to provide greatest numerical value from multiple columns

max( col max(:col1), col max(:col) );

I think this will give you the maximum value for the 2 columns

Jim
Jeff_Perkinson
Community Manager Community Manager

Re: formula to provide greatest numerical value from multiple columns

It's not clear exactly what you want, @aadecarlojr.

 

If you want the maximum value across all the values of the two given columns then the JSL that @txnelson gave above will work.

 

If, on the other hand, you want something like this:

 

A

B

Max of A and B

1

2

2

4

3

4

8

7

8

Then the formula:

 

Maximum(:A, :B)

will give you that.

2022-08-15_15-26-54.698.png

-Jeff
aadecarlojr
Level III

Re: formula to provide greatest numerical value from multiple columns

Thanks to Jeff and TxNelson. I did want the latter, row by row maximum of two columns and that works.  In my research we entered separate R and L data but also want a column variable that contains the max from either R or L.

 

Love solutions!

Recommended Articles