IF function?

G

Guest

I have a formula in a cell C6 that reads "a6/b6"...if a6 and b6 are both 0 it returns #DIV/0! erroe msg
I want to add to the original formula so if a6 and b6 return the error msg, the cell get a 0, also if a6 and b6 should have numbers that return a +value then I want the original formula to return the value...(a6/b6

Any suggestions? I know this must be confusing...it is for me. Have tried the following with no correct resulTS
A6/B6+IF(C6=#DIV/0!,0,[A6/B6]

thanks in advance
 
A

Alan

=IF(B6<>0,A6/B6,0)
Regards,
Jim said:
I have a formula in a cell C6 that reads "a6/b6"...if a6 and b6 are both 0 it returns #DIV/0! erroe msg.
I want to add to the original formula so if a6 and b6 return the error
msg, the cell get a 0, also if a6 and b6 should have numbers that return a
+value then I want the original formula to return the value...(a6/b6)
Any suggestions? I know this must be confusing...it is for me. Have tried
the following with no correct resulTS.
A6/B6+IF(C6=#DIV/0!,0,[A6/B6])

thanks in advance
 
A

Aladin Akyurek

One of:

=IF(B6,A6/B6,0)

=IF(N(B6),A6/B6,0)

Jim said:
I have a formula in a cell C6 that reads "a6/b6"...if a6 and b6 are both 0 it returns #DIV/0! erroe msg.
I want to add to the original formula so if a6 and b6 return the error
msg, the cell get a 0, also if a6 and b6 should have numbers that return a
+value then I want the original formula to return the value...(a6/b6)
Any suggestions? I know this must be confusing...it is for me. Have tried
the following with no correct resulTS.
A6/B6+IF(C6=#DIV/0!,0,[A6/B6])

thanks in advance
 
R

Rob

Jim,

Try this formula in C6, =IF(ISERROR(A6/B6),0,A6/B6)

When you say + value do you mean that you only want to return positive
numbers? If so, =IF(OR(ISERROR(A6/B6),A6/B6<0),0,A6/B6) will work.

Regards, Rob


Jim said:
I have a formula in a cell C6 that reads "a6/b6"...if a6 and b6 are both 0 it returns #DIV/0! erroe msg.
I want to add to the original formula so if a6 and b6 return the error
msg, the cell get a 0, also if a6 and b6 should have numbers that return a
+value then I want the original formula to return the value...(a6/b6)
Any suggestions? I know this must be confusing...it is for me. Have tried
the following with no correct resulTS.
A6/B6+IF(C6=#DIV/0!,0,[A6/B6])

thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top