Salesforce.com Formula to Count Weekdays Between Two Dates

If you need a formula for a Salesforce formula field to count the number of weekdays (excluding Saturday and Sunday) between 2 dates, you can use the formula below.

The formula below calculates the number of days a Salesforce case is open, or has been opened until it was closed:

ROUND(
(IF(ISBLANK(Close_Date__c), TODAY(), Close_Date__c) - DATEVALUE(CreatedDate)) - (
2 * FLOOR(
(
MOD(DATEVALUE(CreatedDate) - DATE(1900, 1, 1), 7) +
(IF(ISBLANK(Close_Date__c), TODAY(), Close_Date__c) - DATEVALUE(CreatedDate))
) / 7
)
),
0
)
+1

Leave a Reply

Your email address will not be published. Required fields are marked *