Average with blank cells

dine9

New Member
Joined
Dec 7, 2009
Messages
14
I really am stuck need to average the answers across a row sometimes these will be blank, but they are alternate eg, h5,j5,l5,n5,r5 need to get a accurate average figure.if somebody can help i am new to excel. I am using 2007. Thanks in advance.
 
When using the AVERAGE function, empty cells (or blank cells) are not counted. Anything with a zero value is though. (type "average'" into Help on Excel and it explains further).

So, taking this into account, and assuming your 'blank' cells really are blank, you can average by the following:

=AVERAGE(H5:R5)

Of course, anything from H5 to R5 gets averaged (unless, as I stated, it is truely blank).

Hope this helps.
 
Upvote 0
welcome to the board

you can get around this by going back to first principles of averaging - i.e. average = sum divided by count

sum(cell1:cell2) will be correct

but count(cell1:cell2) can be wrong in certain circumstances, such as when the formula returns "" (which annoyingly, is not the same as an empty cell). Instead, you could replace this with e.g. countif(cell1:cell2,<>"") or countif(cell1:cell2,">0")
 
Upvote 0
=SUM(h5,j5,l5,n5,r5) / 5

If you have column headers for the answers in say row 1 maybe something like "Answer 1, Answer 2, Answer 3... etc

=SUMIF($1:$1, "*Answer*", 5:5) / COUNTIF($1:$1, "*Answer*")
 
Last edited:
Upvote 0
they work but if a number is inputed between the rows it gives a different answer. sorry i cant give a example as the information on the sheet is confidential.
 
Upvote 0
Couldn't you name the range with the specific cells you want averaged then average them that way, or are you not always averaging the same cells?
 
Upvote 0
tried =IF(COUNTIF(H4:J4:L4:N4:P4:R4,">0")=0,"",SUM(H4,J4,L4,N4,P4,R4)/COUNTIF(H4:J4:L4:N4:P4:R4,">0"))
but it does the same.
 
Upvote 0
Excel 2007 also has two new functions called AVERAGEIF and AVERAGEIFS

=AVERAGEIF( Range, Criteria, Average Range)

=AVERAGEIFS ( Average_range, Criteria_range1, Criteria1, Criteria_range2, Criteria2, ...)
 
Upvote 0
I really am stuck need to average the answers across a row sometimes these will be blank, but they are alternate eg, h5,j5,l5,n5,r5 need to get a accurate average figure.if somebody can help i am new to excel. I am using 2007. Thanks in advance.

Control+shift+enter, not just enter:

=AVERAGE(IF(MOD(COLUMN(H5:R5)-COLUMN(H5),2)=0,IF(ISNUMBER(H5:R5),H5:R5)))

This assumes that you also want to include P5 in the average.
 
Upvote 0

Forum statistics

Threads
1,226,772
Messages
6,192,928
Members
453,767
Latest member
922aloose

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top