Average of 5 different cells (not a range), ignoring zeros.

EddieD

New Member
Joined
Jun 12, 2014
Messages
30
Office Version
  1. 365
Platform
  1. MacOS
Hi everyone,
Im trying to find the average of a series of cells, however they are not all in sequential columns. I also want the formula to skip over cells with zero figures, not averaging those.

Here's what I had, without the zero function:

=AVERAGE(C189,O189,AA189,AM189,AY189)

Here's my attempt with skipping the zeros - which doesn't work.

=AVERAGEIF(C189,O189,AA189,AM189,AY189, "<>0")

Thanks for your help.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
MrExcelPlayground12.xlsx
FGHIJKLM
762079
Sheet11
Cell Formulas
RangeFormula
F7F7=SUM(INDEX(G7:M7,1,{1,3,5,7}))/SUMPRODUCT(--(INDEX(G7:M7,1,{1,3,5,7})<>0))
 
Upvote 0
Hi

Or:
Excel Formula:
=AVERAGE(FILTER(C189:AY189,(C189:AY189<>0)*{1.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0.0.0.0.0.0.0.0.0.1.0.0.0.0.0.0.0.0.0.0.0.1}))
 
Upvote 0
Can you kindly help me understand the 1.0.0.0 ..... etc?
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Do you have column headers where there is a common identifier that could be used to pick out the columns to average?

If you do then you can do it with something based on
Excel Formula:
=AVERAGEIFS(C189:AY189,C189:AY189,"<>0",C$1:AY$1,"*header*")

Without suitable identifiers in the headers, maybe something like
Excel Formula:
=LET(a,INDEX(189:189,1,SEQUENCE(1,5,3,12)),AVERAGE(IF(a,a)))
 
Upvote 0

Forum statistics

Threads
1,214,849
Messages
6,121,925
Members
449,056
Latest member
denissimo

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