2 Antworten
Look at the section 'Find the Number of Business Days Between Two Dates' on this pagehttps://developer.salesforce.com/docs/atlas.en-us.usefulFormulaFields.meta/usefulFormulaFields/formula_examples_dates.htmReproduced here:"Calculating how many business days passed between two dates is slightly more complex than calculating total elapsed days. The basic strategy is to choose a reference Monday from the past and find out how many full weeks and any additional portion of a week have passed between the reference date and your date. These values are multiplied by five for a five-day work week, and then the difference between them is taken to calculate business days.
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."(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 ) ) )