functions-using average across columns

kwg

Board Regular
Joined
Apr 26, 2003
Messages
75
Need to use the average function and apply to only cells with a value greater than 0 across a range of 13 cells.

Example: 3 of the 13 cells have values over 0 but the "average" function in excel applies the calculation to the entire range with includes all the zeros. I only want to apply the average to cells with value > 0. I can visually count the cells and divide but quite a headache with over 1000 lines of data entries.
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
=AVERAGE(IF(Range,Range))

which must be confirmed with control+shift+enter instead of just enter.
 

fairwinds

MrExcel MVP
Joined
May 15, 2003
Messages
8,638
Hi,

Try:

=AVERAGE(IF(A1:M1>0,A1:M1))

That you need to enter with Ctrl + shift + enter
 

onlyadrafter

Well-known Member
Joined
Aug 19, 2003
Messages
5,703
Platform
  1. Windows
Hello,

I know there must be a better way, but here is one option

=SUMIF(A1:F1,">0",A1:F1)/COUNTIF(A1:F1,">0")

Change the cell refs as required,

Is this any use?
 

Watch MrExcel Video

Forum statistics

Threads
1,122,519
Messages
5,596,635
Members
414,083
Latest member
Mrsash

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
Top