Discussion Re: Excel 2007 average discrepency in Excel
https://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2269172#M96164
If a person can remember how to do it, algebra is very useful. My trouble is that not only do I not remember most of how to do it, I can't even remember that there's a way to do it. If I could remember that much then I could always look it up. Maybe when Mark Twain said, "There's lies, **bleep** lies, and statistics" he was thinking about people like me who can sort of do it but not correctly. One example I saw on the internet showed that David Justice's batting average was better than Derek Jeter year over year but when done correctly overall Derek's was better. It showed me that the interpretation of statistics is not as easy as it looks.<BR />Thanks for the replyTue, 13 Apr 2021 02:12:33 GMTBettypin2021-04-13T02:12:33ZExcel 2007 average discrepency
https://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2266648#M96034
<P>I am averaging a group of numbers in Excel 2007 that have 21 columns & 42 rows. When I average all the cells at once I get one result, 59.25183, but when I average each row & then average those results I get an entirely different result, 72.791. Also if I average each column & then average those results it gives a different number, 49.231. In trying to figure out why I created another sheet with the same number of columns & rows & filled it with random numbers. All the cells were filled with numbers & when I did the above all the results were the same. But when I started deleting values in some of the cells the 3 results began to differ. The more I deleted the bigger the difference became between the 3 averages. Can anyone explain why this happens & which result is correct? To reiterate, if all the cells have numbers, the average results are exactly the same, but some cells are empty. the results are not the same. Can anyone explain why this happens?</P>Sun, 11 Apr 2021 16:21:52 GMThttps://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2266648#M96034Bettypin2021-04-11T16:21:52ZRe: Excel 2007 average discrepency
https://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2266790#M96042
<P><LI-USER uid="1022953"></LI-USER> </P><P>Re: ``All the cells were filled with numbers & when I did the above all the results were the same. But when I started deleting values in some of the cells the 3 results began to differ``</P><P> </P><P>That is right. And the issue has nothing to do with Excel. It has to do with mathematics.</P><P> </P><P><FONT color="#FF0000">In general, the average of averages of the parts is not the same as the average of the whole. And the correct answer is the average of the whole. </FONT></P><P> </P><P>Alternatively, we can calculate a <FONT color="#FF0000">weighted average</FONT>, which is the sum of each partial average times a weighting factor. Each weighting factor is the number of values in the part divided by the number of values in the whole.</P><P> </P><P>The exception is: when each part has the same number of values, then the average of the partial averages equals the average of the whole.</P><P> </P><P>Math and algebra might not be your thing. But perhaps the following will make sense to you, anyway.</P><P> </P><P>Consider two partial averages: (10+20+30)/3 and (40+50)/2.</P><P> </P><P>The average of the two partial averages is: ( (10+20+30)/3 + (40+50)/2 ) / 2</P><P> </P><P>That reduces to ( 2*(10+20+30) + 3*(40+50) ) / 12, where 12 = (3*2)*2.</P><P> </P><P>In contrast, the average of the whole is (10+20+30+40+50)/5.</P><P> </P><P>If the difference is not apparent, calculate these two values:</P><P> </P><P>=AVERAGE(AVERAGE(10,20,30), AVERAGE(40,50))</P><P>which is the same as</P><P>=SUM( SUM(10,20,30)/3, SUM(40,50)/2 ) / 2</P><P> </P><P>versus</P><P> </P><P>=AVERAGE(10,20,30,40,50)</P><P>which is the same as</P><P>=SUM(10,20,30,40,50)/5</P>Tue, 13 Apr 2021 14:18:58 GMThttps://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2266790#M96042Joe User2021-04-13T14:18:58ZRe: Excel 2007 average discrepency
https://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2266850#M96047
<P><LI-USER uid="1022953"></LI-USER> </P><P> </P><P>When all of the cells are filled in, then the individual row and column averages have the same denominator, so the average of parts is equivalent to the average of the whole.</P><P> </P><P>Say you have a 3x3 grid of numbers (X1 through X9). Averaging the rows or columns and then averaging those results can be represented as:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMB17_0-1618165808138.png" style="width: 400px;"><img src="https://techcommunity.microsoft.com/t5/image/serverpage/image-id/271838i73444969709BE0D7/image-size/medium?v=v2&px=400" role="button" title="JMB17_0-1618165808138.png" alt="JMB17_0-1618165808138.png" /></span></P><P> </P><P>If you remember your algebra, fractions with the same denominator can be added, so this is equivalent to:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMB17_1-1618165996633.png" style="width: 400px;"><img src="https://techcommunity.microsoft.com/t5/image/serverpage/image-id/271839i67521E96F7FA0BA9/image-size/medium?v=v2&px=400" role="button" title="JMB17_1-1618165996633.png" alt="JMB17_1-1618165996633.png" /></span></P><P> </P><P>which simplifies to this, and is the exact same as the average of the whole:</P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMB17_2-1618166164060.png" style="width: 400px;"><img src="https://techcommunity.microsoft.com/t5/image/serverpage/image-id/271840iD4876C15D1AF8D20/image-size/medium?v=v2&px=400" role="button" title="JMB17_2-1618166164060.png" alt="JMB17_2-1618166164060.png" /></span></P><P> </P><P>When you start deleting cells, the average function excludes those cells. Say you delete X2, X3, and X4. You then have this, where each average of the parts (fractions in the numerator) have different denominators:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMB17_3-1618166325789.png" style="width: 400px;"><img src="https://techcommunity.microsoft.com/t5/image/serverpage/image-id/271841i7AF9B415E83BCB9D/image-size/medium?v=v2&px=400" role="button" title="JMB17_3-1618166325789.png" alt="JMB17_3-1618166325789.png" /></span></P><P> </P><P>Then, getting common denominators and simplifying, you will see that averaging the parts is not the same as averaging the whole:</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JMB17_4-1618166721906.png" style="width: 400px;"><img src="https://techcommunity.microsoft.com/t5/image/serverpage/image-id/271842iB0415673A71F5E76/image-size/medium?v=v2&px=400" role="button" title="JMB17_4-1618166721906.png" alt="JMB17_4-1618166721906.png" /></span></P><P> </P><P> </P>Sun, 11 Apr 2021 18:51:15 GMThttps://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2266850#M96047JMB172021-04-11T18:51:15ZRe: Excel 2007 average discrepency
https://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2269168#M96163
<P><LI-USER uid="146717"></LI-USER> Thanks for the reply. Even though it's been 50 years since my last algebra class your answer was very clear & understandable. I Googled "average of averages" & found some fascinating websites that dealt with this subject & learned about Simpson's Paradox. I was pretty sure it wasn't a problem with Excel but because of another problem with blank cells I wasn't positive. When I first d/l the data in a spreadsheet & sort from high to low by any column that has blank cells it always puts the blank cells in the top so I have to block mark the empty cells & hit delete. Then when I re-sort the high row will be at the top & the blank cells at the bottom as should be. Try as I might I can't find a way to figure out what character is in the cells so I can remove them from the entire sheet all at once.</P><P>Thank you once again</P>Tue, 13 Apr 2021 02:00:45 GMThttps://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2269168#M96163Bettypin2021-04-13T02:00:45ZRe: Excel 2007 average discrepency
https://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2269172#M96164
If a person can remember how to do it, algebra is very useful. My trouble is that not only do I not remember most of how to do it, I can't even remember that there's a way to do it. If I could remember that much then I could always look it up. Maybe when Mark Twain said, "There's lies, **bleep** lies, and statistics" he was thinking about people like me who can sort of do it but not correctly. One example I saw on the internet showed that David Justice's batting average was better than Derek Jeter year over year but when done correctly overall Derek's was better. It showed me that the interpretation of statistics is not as easy as it looks.<BR />Thanks for the replyTue, 13 Apr 2021 02:12:33 GMThttps://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2269172#M96164Bettypin2021-04-13T02:12:33ZRe: Excel 2007 average discrepency
https://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2270310#M96216
<P><LI-USER uid="1022953"></LI-USER> </P><P>Re: ``When I first d/l the data in a spreadsheet & sort from high to low by any column that has blank cells it always puts the blank cells in the top [....] can't find a way to figure out what character is in the cells so I can remove them``</P><P> </P><P>I suspect the "blank" (i.e. blank-appearing) cells contain null strings or non-breaking spaces (ASCII 160; HTML nbsp) that you might have copy-and-pasted-value.</P><P> </P><P>Confirm that formulas of the form =ISTEXT(A1) return TRUE.</P><P> </P><P>If those are the only text in the range, you can delete them with the following procedure.</P><P> </P><P>1. Select the range.<BR />2. Press function key f5 (Go To), and click Special.<BR />3. Select Constants, and deselect Numbers, Logicals and Errors. That is, select only Text.<BR />4. Click OK.<BR />5. Confirm that only the blank-appearing cells are selected. If so, press Delete.</P><P> </P><P>Caveat: This runs the risk of deleting legitimate text inadvertently. It would be prudent to <FONT color="#FF0000">make a backup copy of the file first</FONT>, so that you have something to fall back to if and when you discover any mistaken deletions when it is too late to undo (press ctrl+z).</P>Tue, 13 Apr 2021 15:37:12 GMThttps://techcommunity.microsoft.com/t5/excel/excel-2007-average-discrepency/m-p/2270310#M96216Joe User2021-04-13T15:37:12Z