2 Replies Latest reply on Feb 28, 2011 2:33 PM by DanielPinder

# Calculation for how many days till deadline, but no Sundays

### Title

Calculation for how many days till deadline, but no Sundays

### Post

I have a calculation that gives me the amount of days before a deadline:

Deadline - Get(currentDate)       // the result is a number of days between today and the Deadline

but I need to miss out all the Sundays, because the team needs a day off. So I did this to show the amount of "workable" days:

(Deadline - Get(currentDate)) / 7 * 6

Essentially, I missed out one day per week, but this isn't going to be accurate. How could I substitute the DayOfWeek function (or something) for the cheap little arithmetic I used to achieve a more accurate result?

• ###### 1. Re: Calculation for how many days till deadline, but no Sundays

This seems to work:

Let ( [ Today = Get ( CurrentDate ) ;
Sundays = Div ( Deadline - DayOfWeek (Deadline ) + 2 - today ; 7 ) ] ;
Deadline - Today - Sundays )

• ###### 2. Re: Calculation for how many days till deadline, but no Sundays

AWESOME