IF Formula

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

Guest

Hi,

By using the formula below i am trying to stop the cell in my spreadsheet
displaying #DIV/0! message. could someone offer me a suggestion to tweak it
so that it doesn't as i am stuck!

=IF(F4/H4*100>0,F4/H4*100,"")

Many thanks,
Bryan
 
Try something like this

=IF(ISERR(F4/H4),"",F4/H4)

This should check to see if the division produces an error (Div by 0
included) and it so it will put a blank, other wise it will do the
calculation.
 
F4/H4*100>0

As a very small side note...you could reduce this to: F4/H4 > 0 if you wish.
 
The Problem with your formula is that you used a calculation that divides by
zero in order to find out if it devides by zero. When you run into an error
a small box with an exclimation mark appears. If you click on that and press
Show calculation steps you can see what the computer is doing each step.
Your calculation looks like this (I used 1 as F4 and 0 As H4)

=IF(1/0*100>0,1/0*100,"")
=IF(#DIV/0*100>0,1/0*100,"")
=IF(#DIV/0>0,1/0*100,"")
#DIV/0

The division by zero occured before it could find out if it would happen or
not. So the Error ate right through the formula. Miguels formula (
=IF(H4=0,F4/H4*100,"") ) Works well because it sees if H4 is a zero before it
does any division. Hopefully this explination will help you when you run
into similar Errors in the future.
 

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

Formula problem 1
#Div/0! 3
Formula problem 1
Multiplication problem- Please Help! 8
IF OR Formula 4
Average last 3 entries 3
Can I move the cursor on error?? 3
Formula problem 1

Back
Top