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 » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Formula to rid of DIV/o!



 
 
Thread Tools Display Modes
  #1  
Old April 29th, 2004, 12:45 AM
Sean
external usenet poster
 
Posts: n/a
Default Formula to rid of DIV/o!

hello,

Say A2 = 5.00, B2=0 C2 = DIV/O! - I would like for this to
be blank or show a zero...is this possible?

Thanks,

Sean
  #2  
Old April 29th, 2004, 01:10 AM
steveJ
external usenet poster
 
Posts: n/a
Default Formula to rid of DIV/o!

I use IF formula e.g
In C2: @IF(B2=0,0,A2/B2)

-----Original Message-----
hello,

Say A2 = 5.00, B2=0 C2 = DIV/O! - I would like for this

to
be blank or show a zero...is this possible?

Thanks,

Sean
.

  #3  
Old April 29th, 2004, 01:27 AM
Sean
external usenet poster
 
Posts: n/a
Default Formula to rid of DIV/o!

HI,
When I use this formula, it won't show the values for the
other problems such as:
a2 = 99, b2 = 1, c2 = 99 (a2/b2) - with your formula the
99 appears as zero

thanks for trying

sean
-----Original Message-----
I use IF formula e.g
In C2: @IF(B2=0,0,A2/B2)

-----Original Message-----
hello,

Say A2 = 5.00, B2=0 C2 = DIV/O! - I would like for this

to
be blank or show a zero...is this possible?

Thanks,

Sean
.

.

  #4  
Old April 29th, 2004, 02:21 AM
Alex
external usenet poster
 
Posts: n/a
Default Formula to rid of DIV/o!

Sean

Try
=IF(ISERROR((SUM(A2/B2))),"",(SUM(A2/B2)))
or
=IF(OR(A2=0,B2=0),"",A2/B2)

Alex
  #5  
Old April 29th, 2004, 02:37 AM
Sean
external usenet poster
 
Posts: n/a
Default Formula to rid of DIV/o!

Worked like a charm!

Thanks!
Sean
-----Original Message-----
Sean

Try
=IF(ISERROR((SUM(A2/B2))),"",(SUM(A2/B2)))
or
=IF(OR(A2=0,B2=0),"",A2/B2)

Alex
.

  #6  
Old April 29th, 2004, 07:25 AM
Frank Kabel
external usenet poster
 
Posts: n/a
Default Formula to rid of DIV/o!

Hi
just as a sidenote:
SUM(A2/B2)
is not a good style :-)
The SUM function is not reuired.
Also in your second function you don't have to test for A2=0 as
=0/value
will give you a valid result: 0. So I would use the following formula

=IF(OR(B2="",B2=0),"",A2/B2)

--
Regards
Frank Kabel
Frankfurt, Germany

"Alex" schrieb im Newsbeitrag
...
Sean

Try
=IF(ISERROR((SUM(A2/B2))),"",(SUM(A2/B2)))
or
=IF(OR(A2=0,B2=0),"",A2/B2)

Alex


  #7  
Old April 29th, 2004, 03:20 PM
Jim
external usenet poster
 
Posts: n/a
Default Formula to rid of DIV/o!

I Use if(iserror(a2/b2),"",(a2/b2))
This leaves the cell blank
-----Original Message-----
hello,

Say A2 = 5.00, B2=0 C2 = DIV/O! - I would like for this

to
be blank or show a zero...is this possible?

Thanks,

Sean
.

  #8  
Old April 29th, 2004, 09:09 PM
Harlan Grove
external usenet poster
 
Posts: n/a
Default Formula to rid of DIV/o!

"Frank Kabel" wrote...
...
. . . So I would use the following formula

=IF(OR(B2="",B2=0),"",A2/B2)


More efficient to use N(B2)=0 as the condition.

--
To top-post is human, to bottom-post and snip is sublime.
  #9  
Old April 29th, 2004, 09:53 PM
Frank Kabel
external usenet poster
 
Posts: n/a
Default Formula to rid of DIV/o!


"Harlan Grove" schrieb im Newsbeitrag
...
"Frank Kabel" wrote...
..
. . . So I would use the following formula

=IF(OR(B2="",B2=0),"",A2/B2)


More efficient to use N(B2)=0 as the condition.


Agreed :-)
Frank

  #10  
Old April 29th, 2004, 11:32 PM
Toby Erkson
external usenet poster
 
Posts: n/a
Default Formula to rid of DIV/o!

Easier for newbies to understand what you're talking about when you complete the expression with the "efficiency":
=IF(N(B2)=0,"",A2/B2)

Also, I question the value of "efficient" coding, particularly on small code blocks. If the application is huge with speed and space are considerations then
sure, get efficient. But for readability and overall understanding I think going full efficient is too much work. Unless the programmer is an absolute expert,
trying for efficiency simply for the sake of it can consume unnecessary cycles. It also has the negative effect of making the code more difficult to
understand/read when SOMEBODY ELSE has to take over! (Remember that year 2000 stuff? How many programmers suddenly were doing overtime having to make
corrections and trying to figure out where on somebody else's code...man, I really felt for those COBOL dudes!) I swear I must be the only programmer alive who
documents code (and I'm not talking about examples people post on web sites!) and even then I'm not perfect -- when I look at it I think, yeah, that's obvious
enough that I don't need to comment, and sure enough a month later I'm scratching my head thinking, "Drat! What was I smoking when I wrote THAT? Wish I added
a comment...".

Hey...how did this soapbox get under my desk? :-)

Toby Erkson
Oregon, USA

On Thu, 29 Apr 2004 20:09:14 GMT, Harlan wrote:

"Frank Kabel" wrote...
..
. . . So I would use the following formula

=IF(OR(B2="",B2=0),"",A2/B2)


More efficient to use N(B2)=0 as the condition.


 




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 07:40 AM.


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