Averaging from multiple worksheets within a workbook

walkerma

New Member
Joined
May 13, 2008
Messages
21
I'm trying to do some averages for a year to date "cover" sheet. Worksheet 2 is Jan, Worksheet 3 is Feb, etc..through December. Worksheet 1 is the year to date averages. My data is a formula on each worksheet in cell B22, I thought I had the function written correctly however Excel won't take it:

=AVERAGE(IF(January!B22,February!B22,March!B22,April!B22,May!B22,June!B22,July!B22,August!B22,September!B22,October!B22,November!B22,December!B22<>0, January!B22,February!B22,March!B22,April!B22,May!B22,June!B22,July!B22,August!B22,September!B22,October!B22,November!B22,December!B22,""))

There are blanks,of course, until each month is filled in. Could it be because the number that is in B22 on each worksheet is the result of a formula instead of typed number?? I've spent hours on this...Any ideas out there??
 
Domenic!!!

HOORAY!!!! YOU ROCK!!! YES!!!! (y)

I put the month names at the bottom of sheet one, then changed the formula to reference those cells and it worked!!!! Oh my gosh, I can't possibly thank you enough!!! I have been beating my keyboard, my head, everything...trying to get this to work for two days!!!

Now I will protect that cell so no one can screw it up!!

Again, I can't thank you enough for being at your keyboard and helping me through this!!!!
 
Upvote 0

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
The sheet names can be entered in any range of cells you desire, whether in the same worksheet or another worksheet. So if you'd like to list your sheet names in a worksheet called Sheet2, you can. For example, if you want to enter them in B2:B13, enter January in B2, February in B3, March in B4, and so on. Then change the formula to the following...

=AVERAGE(IF(N(INDIRECT("'"&'Sheet2'!$B$2:$B$13&"'!B22"))>0,N(INDIRECT("'"&'Sheet2'!$B$2:$B$13&"'!B22"))))

Don't forget to confirm the formula with CONTROL+SHIFT+ENTER, not just ENTER. Does this help?

Edit: I see we have success, that's great! Glad I could help!
 
Upvote 0
PS....I can't take the zeros out of the other sheets because the number appears as a result of a formula so are currently defaulting to zero. To get a blank I'd have to remove my formula and I can't do that

You cannot use the January:December reference within an IF function, so unfortunately this might not be an option for you.
 
Upvote 0

Forum statistics

Threads
1,215,205
Messages
6,123,634
Members
449,109
Latest member
Sebas8956

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