Forum Discussion

gopalaraoa's avatar
gopalaraoa
Copper Contributor
Nov 19, 2019

Calculated column help

=IF([Chemical Name]="Dioxane","Yes",IF([Chemical Name]="Tetrahydrofuran","Yes",IF([Chemical Name]="2-Propanol","Yes","")))

 

Is there an easier way to write the function above?  I have a list of 20 chemicals that I would like this column to "search for" and show a "Yes" if it finds a match to [Chemical Name]. 

1 Reply

  • Robin Nilsson's avatar
    Robin Nilsson
    Bronze Contributor

    gopalaraoa  Still long but you can use math and not have to deal with lots of parentheses...

     

    IF([Chemical Name]="Dioxane",1,0) + IF([Chemical Name]="Tetrahydrofuran",1,0) + IF([Chemical Name]="2-Propanol",1,0)

     

    Then, wrap that whole thing in an if statement

    iF(theAboveVeryLongStatement > 0, "Yes", "")

     

Resources