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.

CheckMeasured (g)Accepted (g)
100 g102100
200 g196200
500 g515500
1000 g9801000
50 g5350
250 g245250
zero20

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%:

CheckMeasured (g)Accepted (g)Absolute percent error
100 g1021002.00%
200 g1962002.00%
500 g5155003.00%
1000 g98010002.00%
50 g53506.00%
250 g2452502.00%
zero20n/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.

Oscar

Spreadsheet nerd who writes about Excel and Google Sheets formulas.

Google Sheets, 1 December 2026, new private unshared spreadsheet (locale already en_US at creation and left unchanged, 1000-row grid, timezone set to America/New_York only on this file). Formulas were entered as user input through the Sheets API. Error text was read from the Sheets API errorValue.message field. Percentage displays were read under 0% and under 0.00%; the results tables in the body use 0.00% unless noted. Measured 102 vs accepted 100: ABS(B2-C2)/ABS(C2) returned 0.02, displayed 2% under 0% and 2.00% under 0.00%. Dividing by the measured value returned 0.0196078431372549, displayed 1.96% under 0.00% and 2% under 0%. Signed (B2-C2)/C2 returned 0.02 for 102 vs 100 and -0.02 for 98 vs 100, the latter displayed -2.00% under 0.00%. 5/100 returned 0.05, displayed 5% under 0%; 5/100*100 returned 5, displayed 500% under 0%. For -18 vs -20, ABS(B2-C2)/C2 returned -0.1, displayed -10.00% under 0.00%; ABS(B2-C2)/ABS(C2) returned 0.1, displayed 10.00%; the fully signed (B2-C2)/C2 also returned -0.1. Unguarded ABS(B2-C2)/ABS(C2) on accepted 0, and on a genuine blank accepted value, each returned #DIV/0!, "Function DIVIDE parameter 2 cannot be zero." IF(C2=0,"n/a",ABS(B2-C2)/ABS(C2)) returned n/a for 0 and for a genuine blank, and 0.02 for 102 vs 100. A formula-produced "" in the accepted cell is not equal to 0 (ISBLANK FALSE); the same IF still returned that #DIV/0!; IF(OR(C2="",C2=0),...) returned n/a. On the seven-row scale sample, the guarded formula in D2:D8 displayed 2.00%, 2.00%, 3.00%, 2.00%, 6.00%, 2.00%, and n/a under 0.00% (2%, 2%, 3%, 2%, 6%, 2%, n/a under 0%). AVERAGE(D2:D8) returned 0.028333333333333335, displayed 2.83% under 0.00% and 3% under 0%. AVERAGE(ARRAYFORMULA(IF(C2:C8=0,"",ABS(B2:B8-C2:C8)/ABS(C2:C8)))) matched that value and those displays. Rounding each row to four decimal places before averaging did not change 0.028333333333333335 on this sample. IFERROR with a FOOBAR typo returned n/a; the IF(C2=0,...) guard left #NAME?, "Unknown function: 'FOOBAR'." A text accepted 100 (ISTEXT TRUE, TYPE 2) was coerced to 0.02; the word hundred returned #VALUE!, "Function MINUS parameter 2 expects number values. But 'hundred' is a text and cannot be coerced to a number." A blank measured value against 100 returned 1. 2.5 vs 0.5 returned 4, displayed 400.00% under 0.00%. Excel was not run.

Next in Sheets Errors & Dynamic Arrays SUM Includes Filtered Rows: Use SUBTOTAL Instead