Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

using IF to skip

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Julie - 14 Mar 2008 22:29 GMT
I am using =NETWORKDAYS(B23,B29)-1 as one of my formulas. I have the -1
because I am tracking several different time frames going from one place to
another and without the -1 it is counting a day twice. I need this formula in
every cell that has the days, but there won't be a time span every time. When
there's no time span i get a -1 in the cell which is messing up count. Is
there a way to add an IF function to the function above that says If -1 then
skip? or count as 0? I've tried several different ways and it's not working.

Thanks
Tyro - 14 Mar 2008 22:47 GMT
=IF(NETWORKDAYS(B23,B29)-1=-1,0,NETWORKDAYS(B23,B29)-1)
=IF(NETWORKDAYS(B23,B29)-1=-1,"",NETWORKDAYS(B23,B29)-1)

The first formula returns 0 for the -1 and the second formula returns the
empty string

Tyro

>I am using =NETWORKDAYS(B23,B29)-1 as one of my formulas. I have the -1
> because I am tracking several different time frames going from one place
[quoted text clipped - 10 lines]
>
> Thanks
Rick Rothstein (MVP - VB) - 14 Mar 2008 22:53 GMT
This formula will let the calculation take place only if both B23 and B29
have entries in them...

=IF(OR(B23="",B29=""),"",NETWORKDAYS(B23,B29)-1)

Rick

>I am using =NETWORKDAYS(B23,B29)-1 as one of my formulas. I have the -1
> because I am tracking several different time frames going from one place
[quoted text clipped - 10 lines]
>
> Thanks
Rick Rothstein (MVP - VB) - 14 Mar 2008 23:00 GMT
And if you want the calculation to take place as long as both are not blank
(which is really what your original question asked)...

=IF(AND(B23="",B29=""),"",NETWORKDAYS(B23,B29)-1)

although I would wonder at the usefulness of an answer if one of the cells
were blank (hence my original answer).

Rick

> This formula will let the calculation take place only if both B23 and B29
> have entries in them...
[quoted text clipped - 17 lines]
>>
>> Thanks
Julie - 14 Mar 2008 23:21 GMT
thank you so much

> This formula will let the calculation take place only if both B23 and B29
> have entries in them...
[quoted text clipped - 17 lines]
> >
> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.