A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Display zero is no data is found



 
 
Thread Tools Display Modes
  #1  
Old May 16th, 2009, 11:55 PM posted to microsoft.public.excel.misc
wcurtis
external usenet poster
 
Posts: 26
Default Display zero is no data is found

I have an IF formula that displays a zero if the number falls between a set
of numbers.
=IF(B30450,B30-450,IF(B30426,B30-426,"0"))
But if no data is found in the reference cell then I want the cell the
formula is in to display 0, how do you do that?
Example would be that B30 is blank, I get a -426.

Thanks in advance.
  #2  
Old May 17th, 2009, 12:12 AM posted to microsoft.public.excel.misc
Sheeloo
external usenet poster
 
Posts: 797
Default Display zero is no data is found

Blank cells are treated as 0 in comaprisons so you can have
=IF(B30450,B30-450,IF(AND(B30"",B30426),B30-426,"0"))

"wcurtis" wrote:

I have an IF formula that displays a zero if the number falls between a set
of numbers.
=IF(B30450,B30-450,IF(B30426,B30-426,"0"))
But if no data is found in the reference cell then I want the cell the
formula is in to display 0, how do you do that?
Example would be that B30 is blank, I get a -426.

Thanks in advance.

  #3  
Old May 17th, 2009, 10:39 AM posted to microsoft.public.excel.misc
JBeaucaire[_92_]
external usenet poster
 
Posts: 196
Default Display zero is no data is found

That works, but it evaluates virtually the entire formula before it discovers
there's nothing to do. I would suggest starting with that test so it can
stop right away if there's no value:

=if(B30="",0,IF(B30450,B30-450,IF(B30426,B30-426,"0")))

--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"Sheeloo" wrote:

Blank cells are treated as 0 in comaprisons so you can have
=IF(B30450,B30-450,IF(AND(B30"",B30426),B30-426,"0"))

"wcurtis" wrote:

I have an IF formula that displays a zero if the number falls between a set
of numbers.
=IF(B30450,B30-450,IF(B30426,B30-426,"0"))
But if no data is found in the reference cell then I want the cell the
formula is in to display 0, how do you do that?
Example would be that B30 is blank, I get a -426.

Thanks in advance.

  #4  
Old May 17th, 2009, 03:51 PM posted to microsoft.public.excel.misc
Sheeloo
external usenet poster
 
Posts: 797
Default Display zero is no data is found

You have a point. However given the information in the post, we don't know
which condition occurs most often. If most of the numbers are more than 450
then it is better to check for it first...

Also when I reply to a post I try to provide an answer which requires
minimum changes to what the person seeking help has already tried so that it
is easier for him/her to understand. I do not try to provide the best/optimum
solution.

"JBeaucaire" wrote:

That works, but it evaluates virtually the entire formula before it discovers
there's nothing to do. I would suggest starting with that test so it can
stop right away if there's no value:

=if(B30="",0,IF(B30450,B30-450,IF(B30426,B30-426,"0")))

--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


"Sheeloo" wrote:

Blank cells are treated as 0 in comaprisons so you can have
=IF(B30450,B30-450,IF(AND(B30"",B30426),B30-426,"0"))

"wcurtis" wrote:

I have an IF formula that displays a zero if the number falls between a set
of numbers.
=IF(B30450,B30-450,IF(B30426,B30-426,"0"))
But if no data is found in the reference cell then I want the cell the
formula is in to display 0, how do you do that?
Example would be that B30 is blank, I get a -426.

Thanks in advance.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:11 PM.


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