Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you count weekdays in a range?

Status
Not open for further replies.
Apr 3, 2002
25
FR
Is there a way of counting the number of weekdays between the current date and the first day of the next month?
 
Gazza,

Try this....

if month(currentdate) = 12 then
dateserial(year(currentdate)+1,01,01)
- currentdate
else
dateserial(year(currentdate),month(currentdate) + 1,01)
- currentdate

You will be counting the number of days to the first day of next month unless its December when you will count upto the 1st of January of the next year.
 
Cheers for that, but it is counting all days to the end of the month. How do I exclude Saturday and Sundays.
 
Cheers for that, but it is counting all days to the end of the month. Any idea how I exclude Saturday and Sundays?
 
I got this response from Ken Hamady to same question. It worked for me.

Good luck.
 
Sorry... Let's try that again..
FAQ149-243 has a formula for calculating the number of business days between any two dates. It also does holidays, but you could skip that part. You need to give it the beginning and end dates.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top