Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chuy
 
Posts: n/a
Default Workday - Saturdays Included - Holidays Excluded


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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default Workday - Saturdays Included - Holidays Excluded

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
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
Workday With Weekends Excluding Holidays Chuy Excel Worksheet Functions 5 January 18th 06 08:04 PM
Stumper WORKDAYS Problem B.D. Excel Discussion (Misc queries) 6 February 19th 05 07:16 PM


All times are GMT +1. The time now is 06:16 PM.

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"