Formula to calculate average and not include blanks or zeros in the calculation

SM mechanic

New Member
Joined
Sep 12, 2017
Messages
36
Office Version
  1. 2007
Platform
  1. Windows
I have a workbook I use to track production with my techs. It has a sheet for each week. At the beginning of the workbook there is a sheet labeled First, and one at the end labeled last. I use the formula =IFERROR(AVERAGE(FIRST:LAST!A1)""), as an example, on a sheet labeled averages. Each week I add a sheet between First, and Last and input their actual production. The formulas are on the AVERAGES sheet. I track their average daily production, as well as average weekly production, and total production. A1 changes in the formula based on what cells I am looking to get an average for. But otherwise that is the formula I use on most of that sheet. Where it goes wrong is when it calculates an average weekly production. I realized the averages aren't right when they take a weeks vacation. I have tried adding <> or <>0 to my equation and neither changes the result.

I also tried taking the the average from the calculated averages on the "Averages" sheet. But averaging the averages for each day, doesn't give a true average weekly number.

I hope this makes sense, I realize it is kind of convoluted.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
are you still using 2007
I think you may need to use indirect() and then a column of sheetnames - which can be named

is that something you could do ?

sumif - will not do 3d references
 
Upvote 1
need to lookup , when frequency () says its in 2007 version

=SUM(FIRST:LAST!A1)/(INDEX(FREQUENCY(FIRST:LAST!A1,0),2))

will not work for negative numbers , copied from another forum

Book3
ABCDEF
1I have 4 sheets , with 0,10,0,10 in cell a1 expected mock up results - on 1 sheet excluding zero
20
3105
45=AVERAGE(FIRST:LAST!A1)0
510=SUM(FIRST:LAST!A1)/(INDEX(FREQUENCY(FIRST:LAST!A1,0),2))1010
Sheet1
Cell Formulas
RangeFormula
F3F3=AVERAGE(D2:D5)
A4A4=AVERAGE(FIRST:LAST!A1)
A5A5=SUM(FIRST:LAST!A1)/(INDEX(FREQUENCY(FIRST:LAST!A1,0),2))
F5F5=AVERAGEIF(D2:D5,">0")



will be on share - only for a few days

other forum found solution
 
Upvote 1
Solution
The formula you wrote with frequency in it worked. To be honest I have no idea what it is doing. But I copied it into my worksheet. Then hand calculated the numbers to check it and it works.

Thank you very much!!
 
Upvote 0
you are welcome
the link i posted from the forum i copied - also have an explanation of the formula - i just used/modified the positive values part - maybe worth a read
 
Upvote 1

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

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