How to Calculate the Absolute Percentage Error with an Excel Function – 2 Methods

Formula to Calculate the Absolute Percentage Error

The absolute percentage error indicates the relative difference between the actual value and the forecast value. The formula is:

To calculate the absolute percentage error, the formula is:

absolute percentage error formula

The formula to calculate the mean absolute percentage error is:

mean absolute percentage error formula


This is the sample dataset.

 

absolute percentage error in excel dataset


Method 1 – Applying the ABS Function

Steps:

  • Select E5.
  • Enter the following formula:

=(ABS(C5-D5)/C5)

applying abs function for absolute percentage error in excel

  • Press Enter.

  • Select the cell again.
  • Drag down the Fill Handle to see the result in the rest of the cells.

filling out abs function in absolute percentage error in excel

  • Select E5:E14 and go to the Home tab.
  • Click the downward arrow beside General in Number.
  • Select Percentage.

This is the output.

applying abs function result for absolute percentage error in excel

 

Read More: Opposite of ABS Function in Excel


Method 2 – Using the IF Function

Steps:

  • Select E5.
  • Enter the following formula:

=IF(D5>C5,(D5-C5)/C5,(C5-D5)/C5)

using if function for absolute percentage error in excel

  • Press Enter.

  • Select the cell again.
  • Drag down the Fill Handle to see the result in the rest of the cells.

filling if formula for absolute percentage error in excel

  • Select E5:E14 and go to the Home tab.
  • Click the downward arrow beside General in Number.
  • Select Percentage.

This is the output.

result of if function in absolute percentage error in excel

 

Read More: Changing Negative Numbers to Positive in Excel


How to Calculate the Mean Absolute Percentage Error in Excel (MAPE Calculation)

Steps:

  • Select E5.
  • Enter the following formula:

=(ABS(C5-D5)/C5)

applying abs function for mean absolute percentage error in excel

  • Press Enter.

mean absolute percentage error of the first reading in excel

  • Drag down the Fill Handle to see the result in the rest of the cells.

  • Select E5:E14 and go to the Home tab.
  • Click the downward arrow beside General in Number.
  • Select Percentage.

  • Select a cell to see the mean absolute percentage (here, E16) and enter the following formula.

=AVERAGE(E5:E14)

applying average function for mean absolute percentage error

  • Press Enter to see the result.

calculating mean absolute percentage error in Excel

 

Read More: How to Sum Absolute Value in Excel


Download Practice Workbook

Download the workbook.


Related Articles


<< Go Back to Excel ABS Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Abrar-ur-Rahman Niloy
Abrar-ur-Rahman Niloy

Abrar-ur-Rahman Niloy, holding a B.Sc. in Naval Architecture and Marine Engineering, has contributed to Exceldemy for nearly 1.5 years. As a leader in Excel, VBA, and Content Development teams, he authored 114+ articles and assisted the Exceldemy forum. Presently, as a project writer, he prioritizes stepping out of his comfort zone, aiming for constant technical improvement. Niloy's interests encompass Excel & VBA, Pivot Table, Power Query, Python, Data Analysis, and Machine Learning libraries, showcasing his commitment to diverse... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo