networkdays

G

Guest

I could use some help with the NETWORKDAYS function in Excel.
First, I want the formula to calculate the number of work-days between two
dates and subtract the holiday's I have hidden in another worksheet. Then, I
want it to subtract two other cells (vacation days, sickdays).

This is what I have:
=NETWORKDAYS(DateFrom,WeekEnd, Holiday)-J12-J13

Lastly, I would like to incorporate the IF ISERROR into the formula so that
anyone using this template without the Analysis ToolPak Addin installed
receives TRUE or FALSE instead of #NAME. That way, I could use a conditional
format to change the font to white if true or false is displayed. For some
reason that doesn't work with #NAME.

Thanks!!!
 
G

Guest

=IF(ISERROR(NETWORKDAYS(DateFrom,WeekEnd, _
Holiday-J12-J13)),"False", _
NETWORKDAYS(DateFrom,WeekEnd, Holiday)-J12-J13)

This is one continuos statement but I broke it up to accomodate the line
breaks caused by this msg setup.
 
T

T. Valko

=NETWORKDAYS(DateFrom,WeekEnd, Holiday)-J12-J13

Is there a problem with the formula? What's in J12 and J13?

You don't need to use conditional formatting to do that. You can use an
error trap directly in the formula that will leave the cell blank:

=IF(ISERROR(NETWORKDAYS(DateFrom,WeekEnd,
Holiday)-J12-J13),"",NETWORKDAYS(DateFrom,WeekEnd, Holiday)-J12-J13)

Biff
 
G

Guest

That doesn't seem to work.
I just get False no mater what values are in Date From, WeekEnd.

I tried to save it and reopen the file but that didn't do it either...

Jason
 
G

Guest

Biff, your formula worked!
Maybe I made a typo with Pop's formula because they appear to be the same
(haven't tracked down the problem yet..)

Thanks guys! You rock!
 
R

Ronald Dodge

Pops included underscores, which only works for VBA writing, not for formula
writing. That is where the difference lies at between Pops vs Valkos
formulas.

Ronald R. Dodge, Jr.
Master MOUS 2000
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top