Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 1 jul, 20:17, "Darrell_Sarrasin via OfficeKB.com" <u33691@uwe
wrote: I need a way of counting workdays between two dates. *i can do it using the NETWORKDAYS function but I know that not everyone has the add ons turned on so its pointless as 100 people will be viewing this. Any Help is greatly appreciated. -- Message posted viahttp://www.officekb.com Hi Darrell, I have had the same problem in the past using Excel 2003. I created this combo of functions: Function isWeekend(aDate As Date) As Boolean If Weekday(aDate, vbSunday) = vbSunday Or Weekday(aDate, vbSunday) = vbSaturday Then isWeekend = True Else isWeekend = False End If End Function Function countWorkdates(datFrom As Date, datUpto As Date) As Integer Application.Volatile Dim intCount As Integer Dim datLoop As Date ' For datLoop = datFrom To datUpto If Not isWeekend(datLoop) Then intCount = intCount + 1 Next countWorkdates = intCount End Function HTH, Wouter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count distinct days from two groups of days | Excel Worksheet Functions | |||
When word says Install I want it count the days for 3 days w.o wee | Excel Worksheet Functions | |||
count work days excluding Fridays and Saturdays ??? | Excel Worksheet Functions | |||
COUNT how many ROWS ago out of 10 days that the highest high in 10 days was made | Excel Worksheet Functions | |||
How do you count work days excluding weekends and holidays? | Excel Discussion (Misc queries) |