cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
fully-yully
Level I

How to create a formula to check if two columns are equal?

Hi everyone,

I would like to sort my data based on whether the value in one column matches the value in another column. Both columns are numeric (continuous scale).

What kind of formula should I use in a new column to check for this equality?

For context, I am trying to identify cases where "Total Number of Biopsies" (Column A) is equal to "Number of Positive Biopsies" (Column B). My goal is to find the cases where all biopsy specimens taken were positive.

Thank you in advance.

2 REPLIES 2
jthi
Super User

Re: How to create a formula to check if two columns are equal?

You can use direct equal comparison or calculate with Col Sum() == value

-Jarmo
txnelson
Super User

Re: How to create a formula to check if two columns are equal?

To create a column that has a value of 1 if column A is equal to column B and has a value of 0 if this is not true do the following:

  1. Create a new column
  2. Right click on the column and select Formula to add a formula to the column to do the calculation
  3. Type in the following formula
    If( :A==:B, 1, 0 );
Jim

Recommended Articles