Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
Solved

# Networkdays Alternative, with Time

Posted on 2009-12-29
Medium Priority
750 Views
Merry Christmas All!

I'm trying to track down an alternative to the NETWORKDAYS formula because for some bizarre reason we aren't allowed to install the Analysis Toolpak at work.

I've got this formula, which works pretty good....

=SUMPRODUCT(--(COUNTIF(HolidayList,ROW(INDIRECT(INT(E3)&":"&TODAY())))=0), --(WEEKDAY(ROW(INDIRECT(INT(E3)&":"&TODAY())),3)<5))

...but it only counts whole days. What I'm after is something that takes the time into account as well. Any ideas?

Cheers,

Wayne
0
• 2
• 2

LVL 50

Expert Comment

ID: 26142629
Hello Wayne,
So given that formula I take it you need to account for holidays? Are you counting all hours of the working days or do you just want to count between specific times?
You have start date and time in E3 I presume so you are taking that time into account but not the end time (just TODAY()?)
Could the start time/date be on a holiday or weekend?
regards, barry
0

LVL 48

Author Comment

ID: 26142769
Hi Barry,

Yes, I need to account for holidays. I basically need to discount the entire 24 hours of any holiday or weekend days.

I had the TODAY() function in the formula because it will fail if I use NOW() because it needs an integer, but I will need to use NOW() in the final formula.

The start time will never be on a weekend or holiday.

Cheers,

Wayne
0

LVL 50

Accepted Solution

barry houdini earned 2000 total points
ID: 26142886
Well, I think you can just use your existing formula with an adjustment for the times. That formula is effectively counting from 12:00 AM on the date in E3 up to the end of today so you can just subtract those times, i.e.
=SUMPRODUCT(--(COUNTIF(HolidayList,ROW(INDIRECT(INT(E3)&":"&TODAY())))=0),--(WEEKDAY(ROW(INDIRECT(INT(E3)&":"&TODAY())),3)<5))-MOD(E3,1)+MOD(NOW(),1)-1
format result cell as [h]:mm
That works assuming today isn't a weekend or holiday. If you want to allow that possibility change to
=SUMPRODUCT(--(COUNTIF(HolidayList,ROW(INDIRECT(INT(E3)&":"&TODAY())))=0),--(WEEKDAY(ROW(INDIRECT(INT(E3)&":"&TODAY())),3)<5))-MOD(E3,1)+(MOD(NOW(),1)-1)*(WEEKDAY(TODAY(),3)<5)*(COUNTIF(HolidayList,TODAY())=0)
regards, barry
0

LVL 48

Author Closing Comment

ID: 31671029
Excellent! Thanks Barry!
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
###### Suggested Courses
Course of the Month10 days, 16 hours left to enroll