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
SabrentSabrent 

GMT Business Days

I have two fields :

 

Exposed_date__c (DateTime)

Approved_Date__c (Date)

 

Can i create a formula to get the difference of the two dates in GMT and only business days?

 

I know how to do this programatically but wondering if this can be achieved in a formula.

 

Thanks in advance for your help.

Blessy Voola 4Blessy Voola 4
Try this:

 (5 * ( FLOOR( ( date_1 - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( date_1 - DATE( 1900, 1, 8), 7 ) ) )
-
(5 * ( FLOOR( ( date_2 - DATE( 1900, 1, 8) ) / 7 ) ) + MIN( 5, MOD( date_2 - DATE( 1900, 1, 8), 7 ) ) )

In this formula, date_1 is the more recent date and date_2 is the earlier date. If your work week runs shorter or longer than five days, replace all fives in the formula with the length of your week.

Thanks!