Average Function Question

TGV525

New Member
Joined
Mar 27, 2011
Messages
4
I would like to get the average for a group of cells ( say X5:BX5 ) but i don't want the cells with zero to be included

I am counting attendance for an event that happens once a week and would like to find out what the average number of people attend over a year

for example week 1 has 15 people attending
week 2 has 20 people attending
the rest of the weeks still have 0 because they have not happened, is there a way to not include them until the # is greater than 0

thank you
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Try this regular formula:
Code:
=SUM(X5:BX5)/COUNTIF(X5:BX5,">0")
is that something you can work with?
 
Upvote 0
Here's one way:
Code:
=SUM(X5:BX5)/COUNTIF(X5:BX5,">0")
 
Upvote 0
I would like to get the average for a group of cells ( say X5:BX5 ) but i don't want the cells with zero to be included

I am counting attendance for an event that happens once a week and would like to find out what the average number of people attend over a year

for example week 1 has 15 people attending
week 2 has 20 people attending
the rest of the weeks still have 0 because they have not happened, is there a way to not include them until the # is greater than 0

thank you
Here are a couple of other ways.

This array entered** formula will work in any version of Excel:

=AVERAGE(IF(X5:BX5>0,X5:BX5))

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

This normally entered formula will work in Excel 2007 and later:

=AVERAGEIF(X5:BX5,">0")
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,881
Members
452,948
Latest member
Dupuhini

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