function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Salesforce Admin 89Salesforce Admin 89 

I need to compare four date fields and display the least date field

IF(
    AND(
        ISBLANK(Date1__c),
        ISBLANK(Date2__c ),
 ISBLANK(Date3__c ),
 ISBLANK(Date4__c )

       ),
    NULL,
    DATE(1900, 01, 01) +
    TODAY()-MIN(
        BLANKVALUE(  Date1__c,  DATE(1900, 01, 01)  ) - DATE(1900, 01, 01),
        BLANKVALUE(Date2__c,DATE(1900, 01, 01)) - DATE(1900, 01, 01),
BLANKVALUE(Date3__c,DATE(1900, 01, 01)) - DATE(1900, 01, 01),
BLANKVALUE(Date4__c,DATE(1900, 01, 01)) - DATE(1900, 01, 01),
    )
)
Jayeshkumar ParmarJayeshkumar Parmar

Hi Salesforce Admin 89,

 

Please try below the formula , 

IF(IF(IF(Date_1__c < Date_2__c, Date_1__c, Date_2__c) < Date_3__c, IF(Date_1__c < Date_2__c, Date_1__c, Date_2__c), Date_3__c) < Date_4__c , IF(IF(Date_1__c < Date_2__c, Date_1__c, Date_2__c) < Date_3__c, IF(Date_1__c < Date_2__c, Date_1__c, Date_2__c), Date_3__c), Date_4__c)

 

 

Please Mark It As Best Answer If It Helps
Thank You.

Salesforce Admin 89Salesforce Admin 89
Hi Jayesh,

I need help in comparing the date fields even if their values are null. if a user is not providing 3 dates if he provides only one then I need to display that field in my formula field.
cfdsgvfs fsdgfvdscfdsgvfs fsdgfvds
The date field is very easy to display if you use this page (https://organiselife.com.au/) source. Lets try it and you will see the comparison and diplay in a better shape.