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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|