Ads

Wednesday, 23 April 2014

IF statements for calculated columns in SharePoint 2010 Lists

Here are some examples of IF statements that can be used in calculated columns.
The IF statement is simply:
IF(condition, ifTrue, ifFalse)
Compare text value:
Scenario: If field1 equals Yes we want to display Approved otherwise display Rejected.
Formula:
=IF([field1]="Yes","Approved","Rejected")
2 conditions must be true using AND:
Scenario: If field1 and field2 both equal Yes then display Approved otherwise display Rejected.
Formula:
=IF(AND([field1]="Yes",[field2]="Yes"),"Approved","Rejected")
Either condition can be true:
Scenario: If field1 OR field2 equal Yes then display Approved otherwise display Rejected.
Formula:
=IF(OR([field1]="Yes",[field2]="Yes"),"Approved","Rejected")
Check if field is blank:
Scenario: If field1 is blank display Approved otherwise display Rejected.
Formula:
=IF(ISBLANK([field1]),"Approved","Rejected")
Compare number column values:
Scenario: If field1 is less than 1 Approved otherwise display Rejected.
Formula:

=IF([field1]<1,"Approved","Rejected")

No comments:

Post a Comment

Ads