# Salesforce Formula Explanation

I cant understand the below Salesforce Formula. Could someone help me to understand this?

IF ( ISBLANK(Actual_Finish_Date__c),
Actual_Start_Date__c), Kickoff__c,
Actual_Start_Date__c ) + 1,
Actual_Finish_Date__c - IF(ISBLANK(
Actual_Start_Date__c), Kickoff__c ,
Actual_Start_Date__c )+1)

Formula Operators and Functions

IF(logical_test, value_if_true, value_if_false)
Determines if expressions are true or false. Returns a given value if true and another value if false

ISBLANK(expression)
Determines if an expression has a value and returns TRUE if it does not. If it contains a value, this function returns FALSE.

Assuming that Deadline__c, Kickoff__c, Actual_Start_Date__c and Actual_Finish_Date__c are Date fields

IF(
ISBLANK( Actual_Start_Date__c ),
Kickoff__c,
Actual_Start_Date__c
)

This formula check whether Actual_Start_Date__c hasn't a value, if so returns the value of Kickoff__c, otherwise the one of Actual_Start_Date__c
E.G.

Actual_Start_Date__c Kickoff__c Result
null 2020-01-01 2020-01-01
2020-01-05 2020-01-01 2020-01-05
IF( ISBLANK(Actual_Finish_Date__c),
IF(
ISBLANK( Actual_Start_Date__c),
Kickoff__c,
Actual_Start_Date__c
)
+ 1,
Actual_Finish_Date__c -
IF( ISBLANK( Actual_Start_Date__c),
Kickoff__c,
Actual_Start_Date__c
)
+1
)

If Actual_Finish_Date__c is null, it returns the days between Deadline__c and Kickoff__c plus one if Actual_Start_Date__c is null, or the days between Deadline__c and Actual_Start_Date__c plus one if the latter isn't null.
If Actual_Finish_Date__c isn't null, it return the days between Actual_Finish_Date__c and Kickoff__c plus one if Actual_Start_Date__c is null, or the days between Actual_Finish_Date__c and Actual_Start_Date__c plus one if the latter isn't null.

null 2020-01-10 null 2020-01-02 9
2020-01-20 2020-01-10 null 2020-01-02 19
null 2020-01-10 2020-01-05 2020-01-02 6
2020-01-20 2020-01-10 2020-01-05 2020-01-02 16
• Thank you for the detailed explanation!! Jan 12 at 1:49

This formula could have been written as: