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.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,210
=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?
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,960
Messages
5,856,525
Members
431,820
Latest member
Tori Murphy

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