hide the #DIV/0!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Allen helped me with this code

=IF(A2/A1<20%,"black",IF(A2/A1<40%,"pink",IF(A2/A1<60%,"orange",...)))

But if I do not have a value in cell A1 or A2 I get #DIV/0!

How can I hide this?
 
Oops, left out the closing bracket. Change that to =IF(OR(A1="",A2=""),"",
and then the rest of your formula.

--
kassie

never stop learning
 
I would add one thing to Kassie's reply. You also get the Div/0! error when
the denominator is zero. So...
=if(or(a1="",a2="",a2=0)...
Assuming a2 is the denominator.
 

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

Back
Top