Percent Error Formula in Excel and Google Sheets
Calculate percent error with the accepted value in the denominator, keep or drop the sign, and guard a zero reference so the cell does not show #DIV/0!.
On this page
A percent error column shows 500% when a 102 g reading is only 2 g off a 100 g weight, or two people type the same weights and get 2.00% and 1.96%. The usual causes are dividing by the measured value instead of the accepted one, or multiplying the formula by 100 and then formatting the cell as a percentage.
For absolute percent error, put the measured value in B2 and the accepted value in C2:
=ABS(B2-C2)/ABS(C2)
Format the result as 0.00%. In Google Sheets, a measured 102 against an accepted 100 returns 0.02, displayed as 2.00%. The figures below were measured in Google Sheets; Excel was not run.
Use the accepted value as the denominator
Enter this fictional kitchen-scale check in A1:C8. Store the weights as numbers. Keep C8 as the number 0, not a blank.
| Check | Measured (g) | Accepted (g) |
|---|---|---|
| 100 g | 102 | 100 |
| 200 g | 196 | 200 |
| 500 g | 515 | 500 |
| 1000 g | 980 | 1000 |
| 50 g | 53 | 50 |
| 250 g | 245 | 250 |
| zero | 2 | 0 |
Row 2 is a 102 g reading against a 100 g reference. The two calculations are:
=ABS(B2-C2)/ABS(C2)
That returns 0.02. Under 0.00% it displays 2.00%.
=ABS(B2-C2)/ABS(B2)
That returns 0.0196078431372549, displayed as 1.96% under 0.00%. Under 0% both results display as 2%, so the difference is easy to miss. For percent error against a reference, divide by the accepted value.
The formula already returns a fraction. 0.05 is 5%. If you also multiply by 100 and then format the cell as a percentage, Sheets multiplies the displayed value by another 100. =5/100 under 0% displays 5%. =5/100*100 is the number 5, and the same 0% format displays 500%. Leave *100 out and use the percentage format, unless a report specifically needs the plain number 5 in a numeric column.
Keep the sign only when you want direction
The signed formula preserves whether the reading was high or low:
=(B2-C2)/C2
102 against 100 returns 0.02. 98 against 100 returns -0.02, displayed as -2.00% under 0.00%. A negative result here means the measurement is below the accepted value. It is not a broken formula. A scale that repeatedly reads low will keep a negative sign in this column.
For a tolerance check, stay with the absolute formula. I keep absolute percent error in the main calibration column and add a signed column only when I am looking for bias.
Negative accepted values need ABS in the denominator
A reference can itself be negative, such as a temperature of -20°C. If you take the absolute difference and then divide by the accepted value without ABS, the result inherits that sign.
For a measured -18 against an accepted -20:
=ABS(B2-C2)/C2
returns -0.1, displayed as -10.00% under 0.00%.
=ABS(B2-C2)/ABS(C2)
returns 0.1, displayed as 10.00%. The absolute denominator keeps the percent as a magnitude.
The fully signed formula (B2-C2)/C2 also returns -0.1 for this pair, but that is a direction result, not a failed absolute calculation.
Guard a zero accepted value
Percent error is undefined when the accepted value is 0, because the formula divides by zero. The unguarded =ABS(B2-C2)/ABS(C2) on row 8 returns #DIV/0!, “Function DIVIDE parameter 2 cannot be zero.” The same error appears if C8 is genuinely blank, because a blank compares like 0.
Check the accepted value explicitly rather than wrapping the whole formula in IFERROR:
=IF(C2=0,"n/a",ABS(B2-C2)/ABS(C2))
On the scale sample, that returns n/a for the zero row and for a genuine blank, and it still returns 0.02 for 102 vs 100. IFERROR would also hide a typo: wrapping a misspelled function name returned n/a, while this IF left #NAME?, “Unknown function: ‘FOOBAR’.”
A formula-produced empty string in the accepted cell is not equal to 0, and ISBLANK of that cell is FALSE, so IF(C2=0,...) still divides and returns the same #DIV/0!. If those cells can appear, use:
=IF(OR(C2="",C2=0),"n/a",ABS(B2-C2)/ABS(C2))
That returned n/a for "", a genuine blank, and 0, and still calculated 0.02 for 102 vs 100.
Average the valid rows
Put the guarded formula in D2, fill it through D8, and format D2:D8 as 0.00%:
| Check | Measured (g) | Accepted (g) | Absolute percent error |
|---|---|---|---|
| 100 g | 102 | 100 | 2.00% |
| 200 g | 196 | 200 | 2.00% |
| 500 g | 515 | 500 | 3.00% |
| 1000 g | 980 | 1000 | 2.00% |
| 50 g | 53 | 50 | 6.00% |
| 250 g | 245 | 250 | 2.00% |
| zero | 2 | 0 | n/a |
=AVERAGE(D2:D8)
AVERAGE ignores the text n/a and averages the six numeric rows. It returns 0.028333333333333335, which displays as 2.83% under 0.00%. Under 0%, the same average displays as 3%. Keep the helper column and the average on 0.00% so those two displays do not get mixed.
If the percentage shows too many decimal places, change the number format. That changes only what you see; AVERAGE still uses the full values. Use ROUND inside the row formulas only when you want the rounded number to feed later calculations. On this sample, rounding each row to four decimal places before averaging did not change the result, because each nonzero error already landed on 0.02, 0.03, or 0.06.
To average directly from the measurement columns in Google Sheets:
=AVERAGE(ARRAYFORMULA(IF(C2:C8=0,"",ABS(B2:B8-C2:C8)/ABS(C2:C8))))
That returned the same 0.028333333333333335, displayed as 2.83% under 0.00%. Excel was not run, so this array form is a Sheets result only.
This average is a mean absolute percentage error. It summarizes the relative deviations, but a reading whose accepted value is close to zero can dominate it: 2.5 against 0.5 returns 4, displayed as 400.00% under 0.00%. Inspect the raw differences as well when the references get that small.
The core ABS, IF, and AVERAGE formulas above are available in both Excel and Google Sheets. The percentage formatting works the same way. I did not re-enter these formulas in Excel.
For a signed change from an old value to a new one, use the percentage change formula instead. If a zero denominator is the whole problem, the #DIV/0! error guide covers the error itself. For a tighter wrapper than IFERROR, see IFERROR vs IFNA. For a one-off calculation without building a sheet, use the percent error calculator.