-1

I have a column with =IF(E2="W ",H2,IF(I2<>"",I2,"")) in it. It displays values but when I take an average of the column, it comes up with a divide by zero error. Is there a special type of average function I need to use for this?

1 Answer 1

1

I assume that H2 and/or I2 are numbers? Perhaps those numbers are text formatted (in which case AVERAGE, not finding any true numbers will return #DIV/0! error). Try converting like this:

=IF(E2="W ",H2+0,IF(I2<>"",I2+0,""))

+0 will convert a text-formatted number to an actual number, then your AVERAGE function should work

2
  • May not not be a problem in this instance, but issue could arise if there are missing data values. If both cells in columns H and I are blank, if value in column E is "W" and value in column H is blank, or if col. E value is not "W" and col. I is blank, solution would evaluate to 0 in the formula column, which would throw the average off if you didn't want to include missing values in it.
    – chuff
    Dec 17, 2012 at 1:03
  • Thanks chuff. I think the latter case is covered but you are right about the former, in which case you could probably add a check for H2 being blank, i.e. =IF(E2="W ",IF(H2<>"",H2+0,""),IF(I2<>"",I2+0,"")) Dec 17, 2012 at 1:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.