0

C16
Google Sheets -> 73%
Calculator -> 73%

F16
Google Sheets -> 72%
Calculator -> 74%

Row 16 is the sum of rows 1-15.

C16 and F16 are the sum of rows 1-15, then divided by 15.

F16 Formula: =SUM(F1:F15)/15

https://docs.google.com/spreadsheets/d/1VhHmNuffurWeXju8-Ftrj_Aw5CqxjmOiuKH97V0XqeY/edit?usp=sharing

googlesheets vs calculator

7
  • Welcome to Web Applications Stack Exchange. Please edit your question and insert a table of sample data. Also consider sharing a publicly editable sample spreadsheet. There is a blank sheet maker that lets you share safely. Commented Sep 10 at 19:38
  • To calculate averages use the native function: =AVERAGE(F1:F15) instead of =SUM(F1:F15)/15 . It has the benefit of not needing you to count the number of items being averaged as you do in SUM, and will also exclude text and blank cells from the calculation.
    – Blindspots
    Commented Sep 10 at 21:37
  • @Blindspots that average() formula gets an incorrect result as well. See my updated answer. Commented Sep 11 at 8:05
  • I'm confused why C16 doesn't yield a 2% difference, but F16 does
    – John
    Commented Sep 11 at 9:36
  • 1
    "why C16 doesn't yield a 2% difference, but F16 does" — that's just a coincidence. Both formulas are semantically incorrect, because you shouldn't "average the averages" and assume that would be the same as the average of the total. To get the correct result, use =sum(A1:A15) / sum(B1:B15) or similar. See my answer and Why is an average of an average usually incorrect? Commented Sep 11 at 11:40

2 Answers 2

1

Google Sheets calculates =218 / 294 to 0.741496598639456 which is quite precisely the same result as the calculator screenshot shows. So the explanation for the different result that is shown in the spreadsheet screenshot is that it depicts an incorrect calculation method.

F16 Formula: =SUM(F1:F15)/15

The formulas in F1:F15 each divide one number by another. The formula in F16 effectively averages those sub-results. But the average of sub-results is not the same as the average of the total.

The error in the calculation method may not become apparent when the values in columns D:E are close to each other, but it is easy to see when the values are more diverse. Consider this example:

row # column D column E column F
row 13 99 1 99 =D13 / E13
row 14 99 1 99 =D14 / E14
row 15 2 98 0.02040816327 =D15 / E15
row 16 200 =sum(D1:D15) 100 =sum(E1:E15) 13.20136054 =sum(F1:F15) / 15
correct result 2 =D16 / E16

To get the correct result, put this formula in cell F16:

=D16 / E16

See Why is an average of an average usually incorrect?

2
  • E16 is exactly 294. It's the sum of E1 down to E15
    – John
    Commented Sep 10 at 19:48
  • Those are also whole numbers. Okay, I linked the actual file above
    – John
    Commented Sep 10 at 20:01
1

Everything is "correct" insofar as neither the calculator nor Sheets is making a mistake. Also, both sheets and the calculator can return either result if you ask them.

You are performing completely different mathematical calculations. If you look at my second example below you will see that the approach you choose can have a much larger impact depending on your data.

Let's say you have a restaurant and want to know what percentage a diner "typically" tips. You could average the tip percentage of each diner, that would be your 72.3% / 40% results.

If you wanted to know how the total of all tips collected compares to the total of all sales, that would be your 74.1 / 23.2% results

If those numbers are very close it doesn't matter. If they were quite different one might try to find out why.

In the case of the second example large bills represent only 1/3 of the "diners" however the percentage tipped on those is 20% vs 50% for small bills which skews the results of both calculations so it is important to understand the "purpose" of the calculation.

array_a: {18, 18, 20, 17, 15, 18, 16, 16, 9, 13, 4, 18, 11, 7, 18}
array_b: {24, 23, 24, 21, 22, 21, 21, 22, 18, 17, 12, 22, 15, 11, 21}

218 = SUM(array_a)
294 = SUM(array_b)

74.1% = 218/294
74.1% = SUM(array_a)/SUM(array_b)
72.3% = AVERAGE(INDEX(array_a/array_b))

An example in more detail:

array_a: {1, 5, 20}
array_b: {2, 10, 100}

=AVERAGE(INDEX(array_a/array_b))
=AVERAGE({1/2, 5/10, 20/100}) 
=AVERAGE({50%, 50%, 20%})
=40%

=SUM(array_a)/SUM(array_b) 
=SUM({1, 5, 20})/SUM({2, 10, 100})
=26/112
=23.2%
5
  • The number 218 is the number correct, and the number 294 is total possible correct. So, would 74% be the right number?
    – John
    Commented Sep 10 at 20:33
  • As I stated they are both "correct" they are different calculations. 72.3% is the average of the results of 15 calculations. 74.1% is the result of dividing 218 by 294. See my second example to better understand what is happening under the covers.
    – Blindspots
    Commented Sep 10 at 20:54
  • I understand the calculations are both correct. But there is only one correct number for percentage correct.
    – John
    Commented Sep 10 at 20:56
  • 72.3% is the average of all the percentages. 74.1% is the percentage of the column totals. Only you know what you are trying to do. I assumed the former because you were calculating the average in Sheets (dividing by 15).
    – Blindspots
    Commented Sep 10 at 21:04
  • I just wanted to know the percentage correct
    – John
    Commented Sep 11 at 3:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.