Hello,

So I am trying to come up with a formula, that if I have a delivery date, My due date will be 2 days before the delivery date. Then I have 3 more processes that lets say, process 1 needs to be done 1 day before the due date. Process 2 needs to be done 2 days before the due date. Process 3 needs to be done 3 days before the due date ect.

What I am trying to do, is have a calculation for each of the calandar fields to stack the dates in the right order, AND not allow the date to fall on a weekend.

Thanks and I really look forward to anyones help on this.

Robby

Try this. Not too extensively tested. There is possibly a more elegant way than this brute force approach, but it should work.

Let ( [

dev = Date ( 5 ; 1 ; 2014 ) ; // SAMPLE DATA – your field

due = Let ( [ d = dev - 2 ; w = DayOfWeek ( d ) ] ; d - Case ( w = 7 ; 1 ; w = 1 ; 2 ) ) ;

p1 = Let ( [ d = due - 1 ; w = DayOfWeek ( d ) ] ; d - Case ( w = 7 ; 1 ; w = 1 ; 2 ) ) ;

p2 = Let ( [ d = p1 - 1 ; w = DayOfWeek ( d ) ] ; d - Case ( w = 7 ; 1 ; w = 1 ; 2 ) ) ;

p3 = Let ( [ d = p2 - 1 ; w = DayOfWeek ( d ) ] ; d - Case ( w = 7 ; 1 ; w = 1 ; 2 ) )

] ;

List ( due ; p1 ; p2 ; p3 )

)

returns

4/29/2014

4/28/2014

4/25/2014

4/24/2014