Saturday 13 May 2017

Populate day name by providing date using Formula Field

1. Create formula field of 'Text' type.
2. Provide Date field in to the formula like--
3. 'Date__Field__c ' is a custom field , you can use your custom or standard field here.
4. Use this formula in your advanced formula area.

IF(MOD(Date__Field__c - DATE(0001,1,1) , 7) == 0 , 'Saturday' , 
IF(MOD(Date__Field__c- DATE(0001,1,1) , 7) == 1 , 'Sunday' , 
IF(MOD(Date__Field__c- DATE(0001,1,1) , 7) == 2 , 'Monday' , 
IF(MOD(Date__Field__c- DATE(0001,1,1) , 7) == 3 , 'Tuesday' , 
IF(MOD(Date__Field__c- DATE(0001,1,1) , 7) == 4 , 'Wednesday' , 
IF(MOD(Date__Field__c- DATE(0001,1,1) , 7) == 5 , 'Thursday' , 
IF(MOD(Date__Field__c- DATE(0001,1,1) , 7) == 6 , 'Friday' , 'No Day')))))) 
)



0 comments:

Post a Comment

If you have any doubts, please let me know.