Calculate date and days.

F

Floyd Forbes

Is there to a way to calculate the numbers of day in a month and exclude
Sundays.

Floyd
 
J

JethroUK©

you could paste in this function:

Function NoSundays(FromDate As Date, ToDate As Date)
'NoSundays returns the number of workdays (excl Sun) between
''FromDate & 'ToDate' inclusive

FromDate = FromDate - 1
Do
FromDate = FromDate + 1
If WeekDay(FromDate) > 1 Then NoSundays = NoSundays + 1
Loop Until FromDate = ToDate
End Function
call it via:

NoSundays([FromDate],[ToDate])
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Calculating dates leaving Sundays out. 2
Show dates 1
Calculate Payment Days and Date 3
Calculate between two dates 3
Number of days 9
counting days worked per month 5
Calculated field 5
Calculating Time Help 2

Top