Average a row of data without zeros

benkong2

New Member
Joined
Feb 19, 2002
Messages
8
My sheet has 4 rows of data and a total row that is supposed to average the results over a week. example:
week1 100
week2 125
week3 140
week4 98
Total =Average(A1:a4)
Problem is if week 2,3 and 4 are empty or my user unknowingly enters a zero the average is incorrect. What I actually want to do is say if week1 is not empty or greater than 0 the average = week1. If week1 and week2 are not empty or greater than 0 then average week1 and week2. Is this possible?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Try this
Book4
EFGHIJKLMNOPQ
15
161001001001001001001000100100100100100
17
18
Sheet1


You need to entry this formular using Control/Shift/Enter keys

pll
This message was edited by plettieri on 2002-10-18 13:59
 
Upvote 0
Another formula option would be
=SUM(A1:A4)/MAX(1,COUNTIF(A1:A4,">0"))

which should work about the same as the array
=AVERAGE(IF(A1:A4,A1:A4))
with your data, except no error message if no entries are made in A1:a4
 
Upvote 0

Forum statistics

Threads
1,213,492
Messages
6,113,967
Members
448,537
Latest member
Et_Cetera

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