Need help...getting #DIV/0!

P

Peter McCaul

My formula is

=if(sum(p6/o6)*100<=0,"",sum(p6/o6)*100)

The formula works fine if there are numbers in p6 and o6 cells. If I leave
it blank I get #VALUE! and if i put a zero I get #DIV/0!. Is there a
solution? Thanks for any help in advance.
 
R

Roger Govier

Hi Peter

Try
=if(o6="","",if(sum(p6/o6)*100<=0,"",sum(p6/o6)*100))


Regards

Roger Govier
 
G

Gord Dibben

Peter

You only have to check the "divide by" cell value.

=IF(O6="","",IF((P6/O6)*100<=0,"",(P6/O6)*100))

Note: you also don't need the SUM Function.


Gord Dibben Excel MVP
 
H

Harlan Grove

Peter McCaul said:
My formula is

=if(sum(p6/o6)*100<=0,"",sum(p6/o6)*100)

The formula works fine if there are numbers in p6 and o6 cells. If I leave
it blank I get #VALUE! and if i put a zero I get #DIV/0!. Is there a
solution? Thanks for any help in advance.
....

Sign is all that matters - you seem to want only positive results. P6/O6 > 0
necessarily implies O6*P6 > 0 unless O6 = 0, but you want to exclude that
case too. Try

=IF(O6*P6>0,P6/O6*100,"")
 

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

Similar Threads

Tighter formula than this? 5
Help with calculation in query!!! 13
nested if loop with logical OR/AND 4
Formula 5
#DIV/0! Errors 5
Surpress Average Error 3
error #DIV/0! 7
Blank cells 5

Top