Calculating an AVERAGE formula

w8n4fri

New Member
Joined
Dec 5, 2005
Messages
14
Hello,
I need some assistance in regards to calculating an AVerage of a workshet where the results have to go onto a different worksheet. Here is the formula that I have tried using but does not work...

=AVERAGE(IF('CompanyA'!I7:I33<>0,I7:I33,""))

what i am doing is trying to calculate the average of column I row 7 -33 but if there is a "0" in the columns do not calculate that row..
Any help would be great..
 
Is there a sheet actually named CompanyA because your newest array doesn't use the same sheet reference you started your post with. Thought you might be typing your arrays instead of selecting the range using the mouse pointer since a sheet name in a formula only requires apostrophes when the sheet name has a space somewhere in it. i.e. CompanyA with space 'Company A' . OK through butting in just thought it might be something simple.
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
to answer both questions...
yes..there is a sheet called COMPANYA... I have subsituted the companys real name with just "COMPANY..

Excel is telling me that it is not a vaild formula..
 
Upvote 0
w8n4fri said:
to answer both questions...
yes..there is a sheet called COMPANYA... I have subsituted the companys real name with just "COMPANY..

Excel is telling me that it is not a vaild formula..

Just copy and paste both formulae I provided in the workbook that houses company and post back the results.
 
Upvote 0
Brian,

Your formulas don't have the ! after the sheet name in each reference. Perhaps that is why the error message?

Should be: =SUM(Company!I7:I33)/MAX(1,COUNT(Company!I7:I33-COUNTIF(Company!I7:I33,0)))
 
Upvote 0
I think we have got it....

=AVERAGE('CompanyA'!I7:I33)/MAX(1,COUNT(CompanyA!I7:I33)-COUNTIF('CompanyA'!I7:I33,0))

now the only problem is that it calculates the average of the whole column and I only want it calculate the average of the columms that have a number greater then 0.... Can this be done..
ex.
2
0
4
5
0
0

I want only Row 1, 4, and 5 to be averaged...so it would be 12:3
 
Upvote 0
Brian..
your formula works but it gives me a total not an average...I need the average of the column that have a number greater then 0.
 
Upvote 0
sorry I probably should have mentioned this before... I am trying to take an average of time...I dont know if this will affect the way the formula is written..
 
Upvote 0
w8n4fri said:
Brian..
your formula works but it gives me a total not an average...I need the average of the column that have a number greater then 0.

My formula averages the range, not summing. And it ignores 0's. Do you have negative numbers?

Edit,

Post some sample data of times in your range and expected answer.
 
Upvote 0
Perhaps

=SUM('Company'!I7:I33)/COUNTIF('Company'!I7:I33,">0") is sufficient?
 
Upvote 0

Forum statistics

Threads
1,216,025
Messages
6,128,356
Members
449,444
Latest member
abitrandom82

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