How to Calculate 6 Working Days Between Two Dates

March 5, 2009 by vba excel
Filed under: Excel Date Functions 
Sponsor

Excel Date Functions Question:

Guys, i have an issue with excel date functions, I have two dates ranging from 9 Nov 2007 to 3 Dec 2007. I want to calculate workdays for this mentained rangeand getting result as 17 Days by putting the formula as networkdays. Problem is that I want to consider 6 working days instead of 5 working days.

The date functions details I actualy need to fill in Excel worksheet is as follows:

Start Date: 9 Nov 2007
End Date : 3 Dec 2007
1) Sundays on : dd-mm-yy , dd-mm-yy,……..
2) Holidays on : ……..
3) Total Working days : ?? (by considering Monday to saturday as working Days)
I am not good in excel vba programing, so please provide me the simplest
solution.

Excel Date Functions Answer:

You might also try this excel vba date functions in the worksheet function ng for another option.

Microsoft Excel Date Functions example:
1. Put the 1st date in cell A1
2. Put the last date in cell A2
3. Put in cells A3 to A12 the holidays
4. Enter this in cell C1:
=GetWorkdays(A1, A2, A3:A12)

Function GetWorkdays(FirstDate As Date, LastDate As Date, _
Optional Hols As Variant) As Integer
Dim i As Integer, ii As Integer, wkdys As Integer
Dim dy As Date
Dim f As Boolean

wkdys = 0
For i = 0 To (LastDate - FirstDate)
dy = CDate(FirstDate + i)
If Weekday(dy) <> 1 Then
f = False
If Not IsMissing(Hols) Then
For ii = 1 To Hols.Count
If Len(Hols(ii)) = 0 Then Exit For
If CDate(Hols(ii)) = dy Then
f = True
Exit For
End If
Next
End If
If Not f Then wkdys = wkdys + 1
End If
Next
GetWorkdays = wkdys
End Function

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • E-mail this story to a friend!
  • Live
  • MisterWong
  • Propeller
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb
  • Print this article!

Rate This Tips:

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading ... Loading ...


Incoming excel search terms

,excel formula working days,excel 6 day work week,working days formula excel,calculate work week in excel,excel calculation for start date duration = end date,excel datediff business days,excel macro date difference,excel workdays,how to calculate work week in excel,6 working days in excel,calculate duration between two dates excel,count month in excel between two date,excel formula working day,excel macro working day calculation,excel vba date difference,mss,six working days in excel,working days formula in excel,working out the difference between two dates in excel,calculate days between two dates excel,calculate days excel remove holidays,calculate duration between two dates with time in excel,calculate remaining days in between working days in excel,calculate work week excel,calculating the first three waiting days for sickness in excel,calculating working day difference between two dates within excel,copying between starting date and end date vba,excel calculate business days,excel calculate difference between two dates in work hours,excel date difference business days,excel formula calculate working days,excel formula for working days,excel macro number of working days between two dates,excel working days saturday,how do i calculate a wrking day date less any holidays in excell,how to calculate working hours in excel,macro for formula workdays,macro to calculate workdays,vba excel difference between two dates,working days excel,working days excel formula,working with dates in excel,6 day work week excel,6 day work week in excel,6 days working formula,6 working day in excel,6 working days,average days between two dates excel,business days difference excel



Related Excel Tips

Comments

4 Comments on How to Calculate 6 Working Days Between Two Dates

  1. Vibhor on Mon, 2nd Nov 2009 12:24 pm
  2. Thanks for this code.. searched a lot..

  3. Abi on Mon, 15th Feb 2010 1:07 pm
  4. Please help me to calculate the time difference between two date which should not include (1. holidays, 2.Weekends, 3.non business work timing)
    (e.g) start date & Time: 2/1/2010 10:23
    End date & Time: 2/3/2010 10:36
    I want to calculate the duration took place between the above two dates.

    Kindly reply me back soon. Egarly waiting for your reply!

    Thanks in advance!

  5. ksk on Thu, 25th Feb 2010 9:11 am
  6. I want to calculate the Business / Working date for each month.(Not considering Saturday & Sunday)

    Eg. Feb 2010
    1st wk working days–> M -1, T- 2, W-3,T-4,F-5.
    like wise for all the weeks.

  7. Neha on Fri, 26th Feb 2010 9:12 am
  8. Hi,

    I tried this function but it returns value as zero …. plz help

    Regards, Neha

Have another excel answer or questions for this problem ?
Feel free to post it here..