Warning

 

Close
Confirm Action

Are you sure you wish to do this?

Cancel Confirm
AR15.COM
8/22/2006 5:23:18 PM EDT
How do you make a formula cell not show an error? For example, I have a cell with the formula =(c3/b3) but there is nothing in c3 and b3 yet. I seem to remember that I knew how do do this once, but I can't remember now.
8/22/2006 5:29:04 PM EDT
[#1]
Put the "IF" in there.

(IF(cell=0,0))
8/22/2006 5:38:44 PM EDT
[#2]

Quoted:
Put the "IF" in there.

(IF(cell=0,0))


For the mentally impaired, WHERE do I put (IF(cell=0,0)) . Right now b3 and c3 would be blank and d3 would be the formula =(c3/b3) and has an error.
8/22/2006 5:43:35 PM EDT
[#3]
Try this:

(use appropriate cell references)

=if(iserror(a1),"",a1)

This will return a blank value if cell A1 contains an error, and the value of A1 if it contains a value.

ETA: this only works in a cell that doesn't contain your value.  See next post.
8/22/2006 5:46:22 PM EDT
[#4]

Quoted:
How do you make a formula cell not show an error? For example, I have a cell with the formula =(c3/b3) but there is nothing in c3 and b3 yet. I seem to remember that I knew how do do this once, but I can't remember now.


(Easier than going back and forth)

=if(or(c3=0,b3=0),0,c3/b3)

The IF command is your friend.  Use it often, use it well.
8/22/2006 5:46:40 PM EDT
[#5]

Quoted:

Quoted:
Put the "IF" in there.

(IF(cell=0,0))


For the mentally impaired, WHERE do I put (IF(cell=0,0)) . Right now b3 and c3 would be blank and d3 would be the formula =(c3/b3) and has an error.


D3 gets


=IF(OR(ISBLANK(B3))*(ISBLANK(C3)),0,(C3/B3))


if you want to make it cool.
8/22/2006 6:00:24 PM EDT
[#6]

Quoted:

Quoted:

Quoted:
Put the "IF" in there.

(IF(cell=0,0))


For the mentally impaired, WHERE do I put (IF(cell=0,0)) . Right now b3 and c3 would be blank and d3 would be the formula =(c3/b3) and has an error.


D3 gets


=IF(OR(ISBLANK(B3))*(ISBLANK(C3)),0,(C3/B3))


if you want to make it cool.


ISBLANK isn't a good way to do this.  It doesn't trap the error when the cell it refers to contains a zero, and if the cell it refers to contains ANYTHING, including a formula (even a formula whose result is a blank) then it will return "false". In calculations (most of the time) a blank or null is treated as a zero.

IF you need to keep the cell blank until the calculation is properly completed, you can use something like

=if(or(b3=0, c3=0),"",c3/b3)

The quote marks are a double quote followed by another double quote, with no spaces or anything between.
8/22/2006 6:25:54 PM EDT
[#7]
Thanks, thats what I needed. I KNEW somebody here knew how to do this. What I actually ended up with was

=if(or(c3=0,b3=0),"",c3/b3)

or

=IF(OR(ISBLANK(B3))*(ISBLANK(C3)),"",(C3/B3))