Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() PLEASE I NEED YOUR HELP As Soon As Possible!! Hope You Can Help Me... Just Like The Function Workday But Including Saturdays -------------------- I Require The Date as a Output of The Function... INPUT: Holidays Number Of Days Start Day -Extra-: Including Saturdays. (Workday works only from Monday To Friday) *OUTPUT:* Deadline Day -- Chuy ------------------------------------------------------------------------ Chuy's Profile: http://www.excelforum.com/member.php...o&userid=30603 View this thread: http://www.excelforum.com/showthread...hreadid=502589 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I resorted to VBA. The following UDF should work. I tested it a bit,
but maybe it requires more testing. If you spot any errors post it in the .programming group, since I have to go. Function SatWorkday(StartDay As Date, Duration As Integer, Holidays As Range) As Date Dim MyDay As Date Dim i As Integer i = 1 MyDay = StartDay While i <= Duration MyDay = MyDay + 1 sun = (Application.WorksheetFunction.Weekday(MyDay, 1) = 1) 'hol = Not IsError(Application.WorksheetFunction.Match(MyDay, Holidays, 0)) s = "isnumber(match(" & CLng(MyDay) & "," & Holidays.Address & ",0))" hol = Evaluate(s) If Not sun And Not hol Then i = i + 1 Wend SatWorkday = MyDay End Function This should work as in =SatWorkDay(E1, E2, H1:H3), where E1 is the starting date, E2 the no of days and H1:H3 the holidays. To use it: Alt+F11 for the VBA IDE Insert | Module Paste the code HTH Kostis Vezerides (still eager to see if someone will come up with a formula-based solution) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Workday With Weekends Excluding Holidays | Excel Worksheet Functions | |||
Stumper WORKDAYS Problem | Excel Discussion (Misc queries) |