5 Replies Latest reply on Dec 29, 2009 4:14 PM by leehesler

# Date calculation with working days only

### Title

Date calculation with working days only

### Post

Hello,

I'm trying to find a formula that would add a certain amount of days to a "starting date" but only taking into account the working days of the week (Monday-Friday). I've tried already with a very old post but it's not working properly (Calculating Due date for X number of working days ).

Exemple : add 4 days to today's date (Friday the 11 of September). Answer should be, Thursday the 17 of September.

Cédric

• ###### 1. Re: Date calculation with working days only

Hi Cédric

try this one:

starting date + amount + Int ( amount / 5 ) * 2 + If ( Mod ( amount ; 5 ) + DayOfWeek ( starting date )  ≥ 7 ; 2 )

• ###### 2. Re: Date calculation with working days only

Thanks very much it's working just fine with a small correction.

starting date + amount + Int ( amount / 5 ) * 2 + If ( Mod ( amount ; 5 ) + DayOfWeek ( starting date )  ≥ 7 ; 2 ; 0 )

Even though I don't really understand this formula, it works ... ;-)

• ###### 3. Re: Date calculation with working days only

Macl007 wrote:

Thanks very much it's working just fine with a small correction.

No correction is needed if you are on version > 6

Edit: starting date must be a working day.

• ###### 4. Re: Date calculation with working days only

raybaudi wrote:

starting date must be a working day.

This can be fixed by pulling StartDate back to a work day:

Let (

d = StartDate - Choose ( Mod ( StartDate + 1 ; 7 ) ; 1 ; 2 )
;
d + n + 2 * Div ( n ; 5 ) + 2 * ( Mod ( n ; 5 ) + DayOfWeek ( d ) ≥ 7 )
)

• ###### 5. Re: Date calculation with working days only

HI thanks for this it has helped me although I understand the first part of the formula It still works without the following + If ( Mod ( amount ; 5 ) + DayOfWeek ( starting date )  ≥ 7 ; 2 ) Could you possibly explain this last bit of the formula, sorry Im newbie working with friend on version 10

Best

Lee

Again thanks