DIV/0 Error

  • Thread starter John C. Harris, MPA
  • Start date
J

John C. Harris, MPA

This is going to seem really simple for you all but I need some guidance
here.

I have two cells with numbers. In the next cell these two divide to give me
a percentage. At the end of that column I have a formula for calculating the
average (ex. =Average A1:G1).

The problem is that if the two cells are empty, it gives me the #DIV/0 in
the formula cell, which then in turn gives me the #Div/0 in the Average
Cell. If I put in false numbers, it gives me the correct percentage in that
row, but still, because some of the rows are not filled, the average formaul
does not work. A way around this is to use the formulka only in the rows
with data, but I know there is another way to do this.

Can anyone help please?
 
H

Harald Staff

=IF(COUNTA(A1:G1)>0,AVERAGE(A1:G1),"No values")
Replace "No values" with number 0 if you need the cell for dependant
calculations.

For the percentage, same logic:
=IF(B5>0,B5/A5,"No values")
 

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

Ignoring Blank cells 9
#DIV error 5
Why the #DIV/0 error??? 1
Array formula difficulty 10
#DIV/0! ERROR 2
Producing empty cell rather than #DIV/0! 9
#DIV error 2
#DIV/0! 3

Top