Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give the following function a try...
Function AddWorkDays(StartDate As Date, WorkDays As Long) As Date If WorkDays < 0 Then Exit Function AddWorkDays = DateAdd("d", 7 * (WorkDays \ 5) + (WorkDays Mod 5) - _ 2 * ((WorkDays Mod 5) Abs(5 + - _ Weekday(StartDate, vbMonday))) + _ Weekday(StartDate, vbSaturday) * _ (Weekday(StartDate, vbSaturday) < 3), StartDate) End Function As written, this function will only *add* workdays to the StartDate. If the WorkDays value is less than 0, then "day zero" (12/30/1899) is returned and can be used for error checking purposes. -- Rick (MVP - Excel) "JillC" wrote in message ... How can I ensure that if I add a number of days to a date (which is a working date) the result will also be a work date -- Thanks, Jill |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Calculate working days but change working week | Excel Discussion (Misc queries) | |||
Making weekend days working days - the system cuts the working tim | Excel Discussion (Misc queries) | |||
How to calculation no. of days (only working days) between two dat | Excel Discussion (Misc queries) | |||
Non working days | Excel Discussion (Misc queries) | |||
Working Days | Excel Programming |