SharePoint 2010 Calculated Column Formula for Two Date Fields
=IF(AND([Date1]="",[Date2]=""),"",IF(AND(NOT([Date1]=""),[Date2]=""),TEXT([Date1],"MM/dd/yyyy"),IF(AND([Date1]="",NOT([Date2]="")),TEXT([Date2],"MM/dd/yyyy"),IF([Date1]=[Date2],TEXT([Date1],"MM/dd/yyyy"),TEXT([Date1],"MM/dd/yyyy") & " to " & TEXT([Date2],"MM/dd/yyyy"))))
--------------
Scenarios this formula addresses when you have 2 date columns:
--------------
Scenarios this formula addresses when you have 2 date columns:
- When both are empty, you would not like to show anything
- When one is available and another is empty, you would like to show only that available date
- When both are available and are different, you need to show Date 1 to Date 2
- When both are same, only one date must be displayed
Comments
Post a Comment