3

I have been trying to figure this out and I cannot solve it.

I am trying to create something which say IF column a = "High" AND Column b ="High" THEN "Red" should be inputted. So far I have...

=IF(
    ([Column a]="High" AND([Column b]="High") ) 
    ,"Red"
    , IF(
         ([column a]="High" AND([Column B]="Low") )
         ,Gold"
         , IF(
              ([Column a]="Low" AND([Column b]="High") )
              ,"Green"
              , IF(
                   ([Column a]="Low" ( AND[Column b]="Low") )
                   ,"Black"
                   , ("n/a")
                  )
              )
        )
  )

Thanks in advance

2 Answers 2

6

The formula will be something like this. I have not tested it, but it should work:

=IF(
    AND([Column A]="High",[Column b]="High")
    ,"Red"
    ,IF(
        AND([Column A]="High",[Column b]="Low")
        ,"Gold"
        ,IF(
            AND([Column A]="Low",[Column b]="High")
            ,"Green"
            ,IF(
                AND([Column A]="Low",[Column b]="Low")
                ,"Black"
                ,"NA"
               )
           )
      )
  )

Reference: Calculated Column formulas

1
  • IT WORKED!!!! Thank you so much!!! I killed my brain last night trying to work this out
    – Stephanie
    Commented Sep 9, 2015 at 22:30
0

Correct, contrary to programming languages, SharePoint has Logical Functions, not Operators.
Note: A SharePoint Function can (only) take up to 30 parameters..

More info on available Functions at: https://www.365csi.nl/vm365com/365coach/#/Calculated_Column_Functions_List

If status is always high/low you can condense your Formula to:

=IF(
    [Column A]="High"
    ,IF([Column b]="High"
        ,"Red"
        ,"Gold"
        )
    ,IF([Column b]="High"
        ,"Green"
        ,"Black"
        )
  )

You can copy/paste Formula from here into SharePoint; on save SharePoint will remove all newlines and spaces

Update #1

When you do want the NA option, rewrite it to a way better readable Formula:

=IF([Column A]&[Column b]="HighHigh"
    ,"Red"
    ,IF([Column A]&[Column b]="HighLow"
        ,"Gold"
        ,IF([Column A]&[Column b]="LowHigh"
            ,"Green"
            ,IF([Column A]&[Column b]="LowLow"
                ,"Black"
                ,"NA"
            )
        )
    )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.