Share via

AVERAGEIF function is returning #DIV/0

Anonymous
2017-12-07T17:24:47+00:00

I have a column of values that are the result of an IF equation and I want to take the average of these values excluding blank cells. 

The IF function used is:

      =IF(D2="C","4",IF(D2="C+","5",IF(D2="B","6",IF(D2="B+","7",IF(D2="A-","8",IF(D2="A","9",IF(D2="A+","10","")))))))

So now I have a column made up of values ranging from 4-10 and some blank cells and I want to take the average of this column using

       =AVERAGEIF(E2:E42,"<>0")

This resulted in a #DIV/0! error so I tried using

      =IF(COUNT(E2:E42)>0,AVERAGE(E2:E42),"")

which resulted in a blank cell meaning the IF statement was false.

Why isn't the average function recognizing all the values in column E? I made sure all the cells were formatted as numbers. I'm assuming this problem is because all the values in column E are the results of an equation but I don't know how to get around this.

Hoping someone could help!

Thanks

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Vijay A. Verma 104.9K Reputation points Volunteer Moderator
2017-12-07T17:48:27+00:00

Remove quotation marks around number. Hence, use below formula (Average doesn't operate on Text numbers)

=IF(D2="C",4,IF(D2="C+",5,IF(D2="B",6,IF(D2="B+",7,IF(D2="A-",8,IF(D2="A",9,IF(D2="A+",10,"")))))))

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-12-07T18:09:20+00:00

    Awsome Thanks!

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more