Remaining_days__c = End_date__c - today();

End Date__c is Null in my required case, making Remaining Days as "Null-today()"

I am trying to make this work for a formula field, however its failing. Returns value "-" to Status__c, in case Remaining_days__c>90 which is satisfying the else condition, but returns value "Urgent" i.e. for Remaining_days__c<10, in case when we pass "End_Date__c-today()" in Remaining days, which should ideally pass in else condition.

IF(Remaining_Days__c <0 , "Late", 
IF(Remaining_Days__c <10, "Urgent", 
IF(Remaining_Days__c <30, "Soon", 
IF(Remaining_Days__c <90, "Started", "-"))))

Tried passing value by making Remaining Days as today()-today(), but no luck!


1 Answer 1


Check for the remaining_days__c field is Null value,if it not a Null value then perform your if else condition otherwise just keep the value blank for status.Something like this.

Add formula to

Remaining_days__c = IF( ISNULL(End_date__c),null, End_date__c - today())

Also edited the field Remaining_days__c and status__c, You can see at the bottom 2 option select Treat blank fields as blanks

Updated below code in Status__c formula field

IF(ISNULL( Remaining_days__c ) , "-",
IF(Remaining_days__c <= 0, "Late",
IF(Remaining_days__c < 10, "Urgent" ,
IF(Remaining_days__c < 30, "Soon",
IF(Remaining_days__c < 90,"Started", "-") ) ) ) )

Test 1 :

enter image description here

Test 2:

enter image description here

Field Snapshots enter image description here

enter image description here

  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Adrian Larson
    Commented Aug 9, 2017 at 17:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .