# functions-using average across columns

#### kwg

##### Board Regular
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.

##### MrExcel MVP
=AVERAGE(IF(Range,Range))

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

#### fairwinds

##### MrExcel MVP
Hi,

Try:

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

That you need to enter with Ctrl + shift + enter

#### al_b_cnu

##### Well-known Member
Hi,

=SUM(range)/COUNTIF(range,">0")

HTH

Alan

##### Well-known Member
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?

#### LTunnicliffe

##### Well-known Member

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.

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.

### Which adblocker are you using?

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

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