Averaging the same cell across multiple sheets

%3CLINGO-SUB%20id%3D%22lingo-sub-1817531%22%20slang%3D%22en-US%22%3EAveraging%20the%20same%20cell%20across%20multiple%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1817531%22%20slang%3D%22en-US%22%3E%3CP%3ESo%20I'm%20trying%20to%20reference%20cell%20F2%20across%20multiple%20sheets.%20My%20formula%20is%20as%20follows%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DAVERAGE(January%3ADecember!F2)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20value%20that%20pops%20up%20is%200%20but%20it%20should%20be%204.%20Within%20Excel%2C%20there's%20a%20help%20function%20and%20they%20basically%20tell%20me%20to%20use%20the%20same%20format%20that%20doesn't%20work%20so%20I'm%20at%20wit's%20end%20with%20this.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1817531%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1817557%22%20slang%3D%22en-US%22%3ERe%3A%20Averaging%20the%20same%20cell%20across%20multiple%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1817557%22%20slang%3D%22en-US%22%3EActually%2C%20the%20value%20is%204.36%20but%20it%20should%20be%2012%20because%20the%20total%20number%20across%20all%2012%20cells%20is%2048.%20I%20didn't%20realize%20that%20it%20was%20all%20set%20to%200%20at%20first%20so%20I%20corrected%20it%20but%20the%20number%20should%20still%20be%204%20since%2048%2F12%3D4.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1817585%22%20slang%3D%22en-US%22%3ERe%3A%20Averaging%20the%20same%20cell%20across%20multiple%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1817585%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F845705%22%20target%3D%22_blank%22%3E%40Ayeziza%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAVERAGE%20doesn't%20count%20empty%20cells.%20I%20suspect%20that%20one%20of%20the%2012%20sheets%20has%20a%20blank%20in%20F2.%20That%20would%20cause%20Excel%20to%20divide%20the%20sum%2048%20by%2011%20instead%20of%20by%2012.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E48%2F11%20%3D%204.363636...%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20really%20want%20to%20divide%20by%2012%2C%20you%20should%20either%20enter%20a%200%20in%20the%20blank%20F2%2C%20or%20use%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3DSUM(January%3ADecember!F2)%2F12%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1817586%22%20slang%3D%22en-US%22%3ERe%3A%20Averaging%20the%20same%20cell%20across%20multiple%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1817586%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F845705%22%20target%3D%22_blank%22%3E%40Ayeziza%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWith%20the%20information%20you%20told%20me%2C%20I%20tried%20to%20make%20the%20sample%20file%20and%20%3DAVERAGE%20(January%3A%20December!%20F2)%20function%20properly.%3CBR%20%2F%3EIf%20it%20doesn't%20look%20what%20you%20mean%2C%20it%20would%20be%20better%20if%20you%20could%20include%20files%20to%20clarify%20what%20you%20want.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESony%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1817612%22%20slang%3D%22en-US%22%3ERe%3A%20Averaging%20the%20same%20cell%20across%20multiple%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1817612%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F845705%22%20target%3D%22_blank%22%3E%40Ayeziza%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENothing%20wrong%20with%20the%20formula%20you%20are%20trying%20so%20far.%20Since%20you%20are%20handling%20so%20many%20TABs%20therefore%20I%20would%20like%20to%20suggest%20a%20better%20method%2C%20is%20faster%20also.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3EStore%20Sheet%2FTAB%20name%20in%20any%20blank%20Range%2C%2C%20and%20use%20this%20array%20(CSE)%20formula%20to%20get%20Average.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-markup%22%3E%3CCODE%3E%7B%3DAVERAGE(IF(N(INDIRECT(%22'%22%26amp%3B%24A%241%3A%24A%2412%26amp%3B%22'!F2%22))%26gt%3B0%2CN(INDIRECT(%22'%22%26amp%3B%24A%241%3A%24A%2412%26amp%3B%22'!F2%22))))%7D%0A%0AN.B.%20Range%20A1%3AA12%20contents%20Sheet%2FTAB%20name.%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFinish%20formula%20with%20%3CSTRONG%3ECtrl%2BShift%2BEnter.%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1817666%22%20slang%3D%22en-US%22%3EAveraging%20the%20same%20cell%20across%20multiple%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1817666%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F831408%22%20target%3D%22_blank%22%3E%40SonyBudiarso%3C%2FA%3E%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F127945%22%20target%3D%22_blank%22%3E%40Hans%20Vogelaar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20appreciate%20your%20contributions.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20came%20to%20find%20out%20it%20was%20user%20error%20lol%20(surprise%20surprise).%20Since%20I%20knew%20one%20of%20the%20months%20was%20not%20accounted%20for%2C%20I%20used%20a%20sum%20function%20across%20all%20sheets%20which%20came%20out%20to%20be%2048%2C%20as%20expected.%20So%2C%20I%20just%20went%20into%20each%20month%20and%20altered%20the%20value%20to%20see%20if%20it%20would%20alter%20my%20SUM%20function.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOne%20month%20didn't%20and%20that%20was%20February%20because%20I%20had%20a%20slightly%20different%20format%20where%20the%20data%20I%20wanted%20from%20that%20month%20was%20spaced%20one%20cell%20to%20the%20right.%20After%20fixing%20it%2C%20the%20value%20is%20coming%20up%20as%20correct.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnyway%2C%20I%20apologize%20on%20sending%20you%20guys%20on%20a%20wild%20goose%20chase.%20Not%20sure%20why%20I%20didn't%20think%20of%20trying%20this%20earlier.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1817687%22%20slang%3D%22en-US%22%3ERe%3A%20Averaging%20the%20same%20cell%20across%20multiple%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1817687%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F845705%22%20target%3D%22_blank%22%3E%40Ayeziza%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENo%20need%20to%20apologize%2C%20it%20can%20happen%20to%20all%20of%20us.%20I'm%20glad%20that%20you%20found%20the%20cause%20of%20the%20problem.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1818033%22%20slang%3D%22en-US%22%3ERe%3A%20Averaging%20the%20same%20cell%20across%20multiple%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1818033%22%20slang%3D%22en-US%22%3EAre%20those%20sheets%20in%20order%3F%20More%20importantly%2C%20looking%20left%20to%20right%2C%20is%20January%20the%20left-most%20sheet%20of%20the%20series%20of%20months%20and%20December%20the%20right-most%20sheet%2C%20with%20NO%20sheets%20in-between%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1818330%22%20slang%3D%22en-US%22%3ERe%3A%20Averaging%20the%20same%20cell%20across%20multiple%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1818330%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F93699%22%20target%3D%22_blank%22%3E%40Rajesh-S%3C%2FA%3E%26nbsp%3BPlease%20don't%20take%20this%20personally%2C%20but%20I%20frown%20upon%20using%20the%20INDIRECT%20function%2C%20for%20two%20reasons%3A%3C%2FP%3E%0A%3CP%3E1.%20the%20function%20is%20volatile%20and%20calculates%20on%20any%20change%20in%20your%20file%3C%2FP%3E%0A%3CP%3E2.%20formulas%20using%20INDIRECT%20are%20notoriously%20difficult%20to%20understand%20by%20others.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1818445%22%20slang%3D%22en-US%22%3ERe%3A%20Averaging%20the%20same%20cell%20across%20multiple%20sheets%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1818445%22%20slang%3D%22en-US%22%3ECorrect.%20January%20is%20the%20left%20most%20sheet%20and%20December%20is%20on%20the%20furthest%20right.%20The%20sheets%20in%20between%20are%20the%20months%20that%20come%20between%20January%20and%20December%20of%20the%20same%20year%20so%20Jan%2C%20Feb%2C%20March%2C%20Apr%2C%20May%2C%20etc.%3CBR%20%2F%3E%3CBR%20%2F%3ELike%20I%20said%2C%20the%20issue%20was%20in%20Feb%20where%20the%20data%20I%20needed%20was%20actually%20in%20G2.%20Formatting%20error%20so%20all%20of%20the%20data%20was%20offset%20to%20the%20right%20by%20one.%20Once%20I%20fixed%20that%2C%20the%20formula%20is%20working%20correctly.%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

So I'm trying to reference cell F2 across multiple sheets. My formula is as follows:

 

=AVERAGE(January:December!F2)

 

The value that pops up is 4.36 but it should be 4. Within Excel, there's a help function and they basically tell me to use the same format that doesn't work so I'm at wit's end with this.

 

Essentially, the total number of F2 across all cells is 48, which divided by 12 should be exactly 4 and not 4.36.

 

UPDATE: If you divide 48 by 11, you'll get the number I'm getting in my averaging screen. However, I triple checked that I have 12 tabs referenced so I'm still puzzled at the moment.

12 Replies
Highlighted

@Ayeziza 

AVERAGE doesn't count empty cells. I suspect that one of the 12 sheets has a blank in F2. That would cause Excel to divide the sum 48 by 11 instead of by 12.

 

48/11 = 4.363636...

 

If you really want to divide by 12, you should either enter a 0 in the blank F2, or use

 

=SUM(January:December!F2)/12

Highlighted

Hi @Ayeziza ,

 

With the information you told me, I tried to make the sample file and =AVERAGE (January: December! F2) function properly.
If it doesn't look what you mean, it would be better if you could include files to clarify what you want.

 

Regards,

 

Sony

Highlighted

@Ayeziza 

 

Nothing wrong with the formula you are trying so far. Since you are handling so many TABs therefore I would like to suggest a better method, is faster also.

 

  • Store Sheet/TAB name in any blank Range,, and use this array (CSE) formula to get Average.

 

 

 

{=AVERAGE(IF(N(INDIRECT("'"&$A$1:$A$12&"'!F2"))>0,N(INDIRECT("'"&$A$1:$A$12&"'!F2"))))}

N.B. Range A1:A12 contents Sheet/TAB name.

 

 

 

 

Finish formula with Ctrl+Shift+Enter.

Highlighted

@SonyBudiarso @Hans Vogelaar 

 

I appreciate your contributions.

 

I came to find out it was user error lol (surprise surprise). Since I knew one of the months was not accounted for, I used a sum function across all sheets which came out to be 48, as expected. So, I just went into each month and altered the value to see if it would alter my SUM function. 

 

One month didn't and that was February because I had a slightly different format where the data I wanted from that month was spaced one cell to the right. After fixing it, the value is coming up as correct.

 

Anyway, I apologize on sending you guys on a wild goose chase. Not sure why I didn't think of trying this earlier.

Highlighted

@Ayeziza 

No need to apologize, it can happen to all of us. I'm glad that you found the cause of the problem.

Highlighted
Are those sheets in order? More importantly, looking left to right, is January the left-most sheet of the series of months and December the right-most sheet, with NO sheets in-between?
Highlighted

@Rajesh-S Please don't take this personally, but I frown upon using the INDIRECT function, for two reasons:

1. the function is volatile and calculates on any change in your file

2. formulas using INDIRECT are notoriously difficult to understand by others.

Highlighted
Correct. January is the left most sheet and December is on the furthest right. The sheets in between are the months that come between January and December of the same year so Jan, Feb, March, Apr, May, etc.

Like I said, the issue was in Feb where the data I needed was actually in G2. Formatting error so all of the data was offset to the right by one. Once I fixed that, the formula is working correctly.
Highlighted

@Jan Karel Pieterse ,,

 

I can understand your concern,, since @Ayeziza is trying to access value from 12 different sheets,, in that case the show method is best suitable,, yes is a volatile but here specially reading Sheet Name only so hardly makes any difference,, to avoid this you can assign, a NAME to range A1:A12 (has name of 12 sheets) and use that in Formula like ,,

 

 

 

Replace "'"&$A$1:$A$12&"'!F2"  with  "'"&TabName&"'!F2"

 

 

 

Here TabName is "Named Range" given to A1:A12 has name  of 12 sheets.

                         

Highlighted

@Ayeziza 

Another way is to use helper cell in each of monthly sheets. Let say G2, but it could be in any row/column and you may hide it if needed. Select at once all sheets from Jan to Dec and type in G2

=IF(F2,F2,"")

and after that to average all of them

=AVERAGE(January:December!G2)

AVERAGE() ignores all cells with empty texts.

Highlighted
This puts an unnecessary step,,, to skip blank cells I've shown this in my first post,,

AVERAGE(IF(N(INDIRECT("'"&$A$1:$A$12&"'!F2"))>0,
Highlighted

@Rajesh-S 

Quite often helper cells/ranges save a lot of time on maintenance phase compare to variants where raw data/data preparation/report mixed in one.