Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default count work days

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count distinct days from two groups of days Colin Excel Worksheet Functions 4 February 17th 10 07:14 PM
When word says Install I want it count the days for 3 days w.o wee CYNTHIA Excel Worksheet Functions 1 March 23rd 08 05:28 AM
count work days excluding Fridays and Saturdays ??? Excel Dubai Excel Worksheet Functions 3 February 17th 07 11:38 AM
COUNT how many ROWS ago out of 10 days that the highest high in 10 days was made rhhince Excel Worksheet Functions 1 January 14th 07 09:56 PM
How do you count work days excluding weekends and holidays? Hausma Excel Discussion (Misc queries) 2 April 8th 05 07:39 PM


All times are GMT +1. The time now is 06:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"