Why is this IF statement not working?

I am trying to replace content in one column with data from another IF the original text meets a criteria. That criteria is labeled as "TRUE" in the below. I have tried this 2 different ways:

First with a Calculation:

And again with a Rule:

Can someone explain why this isnt working?

Hi Carl,

In EasyMorph, values in cells can be of the following types:

  • Text
  • Number
  • Boolean (i.e., true or false)
  • Empty (null)
  • Error

Notice the Boolean data type. It's a special logical type with only two possible logical values - true and false. They are not text values "TRUE" and "FALSE". You can see the cell data type when you click the cell:

A condition is an expression that results in logical true or false, or a logical (Boolean) value that is true or false.

The if() function expects a condition as the 1st argument. The [Replace Change Type] column contains not text, but Boolean values true and false. They are not equal to the text values "TRUE" and "FALSE" because they are of a different type. One type never equals another.

Therefore, the correct expression in your case should be:

if([Replace Change Type], [Detail of Change (from Subject)], [Change Type (from Subject)])

Alternatively, you could use the special true() function that generates the logical true value:

if([Replace Change Type] = true(), [Detail of Change (from Subject)], [Change Type (from Subject)])

I recommend checking out our tutorial article on data types and expressions: EasyMorph | Type system and expressions

1 Like