LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Normal Days to business days

Hi Philipp,

You can build your own little VBA function and use it either in your spreadsheet
directly or invoked in a macro.

For an example in a macro:
nWkDays = NWD(DateSerial(2004,4,23), Date)

Function NWD(ByVal Start As Date, ByVal Finish As Date) As Long
Dim Tot As Long, nSat As Long, nSun As Long

Tot = 1 + Finish - Start
nSat = Int((Finish - Weekday(Finish - 6) - Start + 8) / 7)
nSun = Int((Finish - Weekday(Finish) - Start + 8) / 7)

NWD = Tot - nSat - nSun

End Function

Advise if you need the Holidays parameter.

Regards,

Daniel M.

"Philipp Oberleitner" wrote in message
...
Can i embedd this in a macro and is there a possibility to do it without an
addin ?




 
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
Diff in business days JoeL Excel Discussion (Misc queries) 2 May 3rd 10 09:21 PM
Calculating 10 Business Days from the Last Business Day of the Mon Jeff H Excel Worksheet Functions 5 July 16th 09 07:32 PM
UK Business Days Formula WSR Excel Worksheet Functions 1 May 27th 08 02:00 PM
Business Days Only lsmft Excel Discussion (Misc queries) 11 March 10th 06 12:16 PM
How many business days were in 2005? TC Excel Worksheet Functions 6 January 14th 06 08:42 PM


All times are GMT +1. The time now is 08:12 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"