Average

kcdill

Board Regular
Joined
Mar 13, 2002
Messages
106
I am trying to average the values in B38:I38 in eight adjacent columns. The eight cells are linked to eight different spreadsheets. I am using the formula =SUM(SUMIF(B38:I38,{"<0",">0"}))/COUNT(B38:I38). This formula works ok if all eight cells have a value. But when the cell only contains the link formula and no number value the formula wants to divide by eight even if only two cells contain number values. This formula seemed to work in a different spreadsheet but doesn't want to work today. Thanks for your help.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
I assume you are trying to Average without counting zeros.
If so, try this formula:
Code:
=SUM(B38:I38)/COUNTIF(B38:I38,">0")
 
Upvote 0
Good Morning DatSmart:
Your solution works great. One other question. When all eight of the cells are empty the formula returns #DIV/0!. What I would like to see is an empty cell. I tried =IF(I13<>"",SUM(B38:I38)/COUNTIF(B38:I38,">0"),"") but that had no effect. What can I add to your formula to return a blank cell? Thanks again for your help.
 
Upvote 0
do this:
Code:
=if(iserror(SUM(B38:I38)/COUNTIF(B38:I38,">0")),"",SUM(B38:I38)/COUNTIF(B38:I38,">0"))
 
Upvote 0
Try this:
Code:
=IF(COUNT(B38:I38)=0,"",SUM(B38:I38)/COUNTIF(B38:I38,">0"))
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

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