简体   繁体   中英

SharePoint Calculated Columns Formula Issue

I have 9 columns that are set with a range of different numbers from 0-4 representing different statuses. In order for me to make my calculated column equal "Completed" i need to make sure all the 9 columns equal 0,3,4 or blank and nothing else.

Here's what i've come up with but it registers as invalid:

=IF(AND(OR([TF Task Status]=3,[TF Task Status]=4,[TF Task Status]=0,[TF Task Status]="")),AND(OR([TH Task Status]=3,[TH Task Status]=4,[TH Task Status]=0,[TH Task Status]="")),AND(OR([SUP Task Status]=3,[SUP Task Status]=0,[SUP Task Status]="")),AND(OR([EHSD Task Status]=3,[EHSD Task Status]=0,[EHSD Task Status]="")),AND(OR([EHSRV Task Status]=3,[EHSRV Task Status]=0,[EHSRV Task Status]="")),AND(OR([SM Task Status]=3,[SM Task Status]=0,[SM Task Status]="")),AND(OR([TL Task Status]=3,[TL Task Status]=0,[TL Task Status]="")),AND(OR([VP Task Status]=3,[VP Task Status]=0,[VP Task Status]=""))),"Completed","") 

Is there an easy way of doing this? A way that works that isn't overly cumbersome?

Your use of AND operators inside your formula is not correct - you should simply chain the OR conditions as comma-delimited conditions within a single AND operator, as such:

=IF(AND(OR([TF Task Status]=3,[TF Task Status]=4,[TF Task Status]=0,[TF Task Status]=""),OR([TH Task Status]=3,[TH Task Status]=4,[TH Task Status]=0,[TH Task Status]=""),OR([SUP Task Status]=3,[SUP Task Status]=0,[SUP Task Status]=""),OR([EHSD Task Status]=3,[EHSD Task Status]=0,[EHSD Task Status]=""),OR([EHSRV Task Status]=3,[EHSRV Task Status]=0,[EHSRV Task Status]=""),OR([SM Task Status]=3,[SM Task Status]=0,[SM Task Status]=""),OR([TL Task Status]=3,[TL Task Status]=0,[TL Task Status]=""),OR([VP Task Status]=3,[VP Task Status]=0,[VP Task Status]="") ),"Completed","")

Tested & confirmed within a custom list in SharePoint 2010.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM