Holy Cow It Works!!!!!! So that networkdays takes into account weekends
non-work hours and holidays??? Is that right?? Also, what If I want it to set
the work hours to start at 7:30 am and end at 17:00??
THANK YOU SOOOO MUCH!!!!!!!!!!
My Goodness How can I ever repay you for this??
Seriously Thankful!!
Fred
:
Fred,
Try this:
In say cell C1 , formatted as [h]:mm, put
=(9+(MOD(B1,1)-MOD(A1,1))*24+(NETWORKDAYS(A1,B1)-2)*9)/24
Where A1=Start date/time
B1=Finish date/time
My assumption is that start/finish times must be in the 0800 to 1700 window.
You will need to have Analysis Toolpak add-in activated
(Tools==>Add-ins==>Analysis Toolpak) to use the NETWORKDAYS function.
NETWORKDAYS allows you to add holidays into the calculation if this is
required.
For your example I get a result of 6 hours and 6 minutes.
HTH
:
OK, so how would the formula know when to subtract the time because there are
plenty of entries that are made within the range of normal working hours? If
I made a blanket formula it whould have to know when to use the exclusions
and when not to. Any Ideas?
:
That is precisely what I'm saying. You could create a UDF out of this, but I
believe it would just easier to have the person enter a start and end time to
make your calculating easier.
--
http://HelpExcel.com
(e-mail address removed)
:
So your saying that I should have it set up to where every day and weekend
has it's own exclusions set up? Or am I just getting confused?
:
It will work the same way. Just create a string of end & start dates, find
the difference, sum of the total and subtract THAT total from your number in
the example. For example, for every day of the week, you could have the date
& the ending time, 5 PM. The cell below is would be the next day and the
start time. Subtract the difference and you have the portion you want to
exclude. You can do this for every day in between the range and for the
weekend, it would start at 5 PM on Friday evening and end at 8 AM on Monday
morning.
--
http://HelpExcel.com
(e-mail address removed)
:
Sweet, I can see how that will work as a constant for subtract the time
between 5 pm and 8AM but how would I use it as a constant to account for
every weekend and holidays?
Thanks so much,
Fred
:
Fred,
I would also build an exclusion time period. In your example, 1/26/2007 5
PM and 1/29/2007 8 AM. When subtracting, you will get 2 days and 15 hours,
which you can subtract from your formula for the correct time.
--
http://HelpExcel.com
(e-mail address removed)
:
Hi,
I need to figure out how to add time while taking into consideration that
there are weekends and limited work hours. Here's what I have...
Row E13 Row F13 Row K13
01/26/2007 3:41 PM 01/29/2007 12:47 PM 2 days 21 hours 06 minutes
-- The formula for Row K13... =IF(F13<>FALSE,F13-E13,"")
With respect to the length of time, the 27th and 28th were weekend days and
the normal work hours are from 8 to 5. How do I get the formula to subtract
the amount of time that the weekends and off-work hours constitute so that I
come up with a true and accurate amount of time that the user had expended?
Thanks So Much,
Fred "Djinn"