#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 150
Default using IF to skip

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,091
Default using IF to skip

=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

"Julie" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default using IF to skip

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


"Julie" wrote in message
...
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


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default using IF to skip

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


"Rick Rothstein (MVP - VB)" wrote in
message ...
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


"Julie" wrote in message
...
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



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 150
Default using IF to skip

thank you so much

"Rick Rothstein (MVP - VB)" wrote:

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


"Julie" wrote in message
...
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



Reply
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
skip to worksheet raraschek Excel Worksheet Functions 1 March 28th 07 02:42 PM
Can I skip all these questions? grok Excel Discussion (Misc queries) 2 November 17th 06 06:13 PM
If false skip to next irresistible007 Excel Worksheet Functions 1 December 17th 05 11:06 AM
Skip Over Blanks Kenny Excel Discussion (Misc queries) 0 August 3rd 05 11:26 PM
Skip a day of the week Flintstone Excel Discussion (Misc queries) 4 June 6th 05 02:31 PM


All times are GMT +1. The time now is 12:30 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"