Forum Discussion

Jon Gertken's avatar
Jon Gertken
Brass Contributor
Sep 18, 2019
Solved

Need help with nested IF/AND statement for a Calculated Column

I'm having issues getting a calculated column to play nice. Basically in a list I have 7 "Approval" columns that are populated via a Approval Flows. I'm wanting this calculated column to update to "A...
  • Robin Nilsson's avatar
    Sep 18, 2019

    Jon Gertken It's very easy to get tangled up in quotes and missing parens. Plus, you can only next about 7 IF statements, so that makes it more difficult.

     

    What I've done in the past is rethink it a bit to make the syntax a bit easier. I'd count how many of the fields are 'Approved' and then do the logic.

     

    That part would look like:

     

    =IF([column1]="Approved",1,0)+IF([column2]="Approved",1,0)+IF([column3]="Approved",1,0)+IF([column4]="Approved",1,0)+IF([column5]="Approved",1,0)+IF([column6]="Approved",1,0)+IF([column7]="Approved",1,0)

     

    If a column is 'Approved', it adds one to the total, if not, it adds 0. This works because you are using the + for adding.

    Then, wrap that whole thing in a IF(<codeFromAbove>=7,"Approved","Pending"), so the full thing would look like:

     

    =IF(IF([column1]="Approved",1,0)+IF([column2]="Approved",1,0)+IF([column3]="Approved",1,0)+IF([column4]="Approved",1,0)+IF([column5]="Approved",1,0)+IF([column6]="Approved",1,0)+IF([column7]="Approved",1,0)=7,"Approved","Pending")

     

     

Resources