How do I average multiple columns (ignoring zeros and blank cells)?

yeto

New Member
Joined
Mar 1, 2012
Messages
32
Office Version
  1. 2010
Platform
  1. Windows
I am trying to average multiple columns (ignoring zeros and blank cells). I have tried the following formulas. Neither is working. Could someone share as to what I may be dong incorrectly?

=iferrors(AVERAGEIF(E3:E18,J3:J18,">0"),0)
=iferrors(AVERAGEIFs(E3:E18,J3:J18,">0"),0)

Thank you in advance for any help,
yeto
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Attachments

  • test excel photo.JPG
    test excel photo.JPG
    23.3 KB · Views: 12
Upvote 0
That image shows the old formula with iferrors
The data is all 2's,

Can you give us an example of some data and the desired result.
 
Upvote 0
AVERAGEIF doesn't work on disconious ranges. You have to handle it piece by piece.

=(SUMIF(E3:E18,">0")+SUMIF(J3:J18,">0")) / (COUNTIF(E3:E18,">0")+COUNTIF(J3:J18,">0"))
 
Last edited:
Upvote 0
with Power Query
avg.png

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Expand = Table.ExpandListColumn(Table.FromList(Table.ToColumns(Source), Splitter.SplitByNothing(), null, null, ExtraValues.Error), "Column1"),
    Result = #table(1, {{List.Average(Table.SelectRows(Expand, each ([Column1] <> null and [Column1] <> 0))[Column1])}}),
    Rename = Table.RenameColumns(Result,{{"Column1", "Average"}})
in
    Rename
 
Upvote 0

Forum statistics

Threads
1,215,029
Messages
6,122,757
Members
449,094
Latest member
dsharae57

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