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

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Hi,

Try:

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

That you need to enter with Ctrl + shift + enter
 
Upvote 0
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?
 
Upvote 0

Forum statistics

Threads
1,214,998
Messages
6,122,638
Members
449,093
Latest member
Ahmad123098

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