Defeat The Division by Zero Errors in Pivot Tables


excel-formulas-ad-5

If you have a calculated field in your Excel Pivot Table then you may well come across the dreaded #DIV/0! error, which just means that you are attemping to divide a number by zero.

To avoid the error all we need to do is add the IFERROR command in front of our calculated field. You can see in my example below I have a really small extract of data showing some test website ads. I have the cost of the add in Column D and the number of clicks the ads received in Column E.

div error

We can go ahead and create a quick and simple Pivot Table.

  • Hit CTRL+A to select our live data cells
  • Insert Tab
  • Tables Group then choose Pivot Table
  • Select to place the Pivot Table on the existing sheet or a new one

div error1

We now can easily work out the cost per click for each add by adding a calculated field.

  • Click in your Pivot Table to activate the Pivot Table Tools Tab
  • Calculations Group
  • Fields, Items, and Sets
  • Calculated Field
  • Call the Filed Cost Per Click
  • Type the formula as below

div error2

We can see that we have now an error in the result as we have attempted to divide by zero. If we do not fix this we are missing out some great information from this data. Ad i972 has received no clicks!!

div error3

We can easily fix this- by adding the IFERROR statement to the formula as below.

div error4

 

Which now gives the result……

div error5

…..which is much more insightful.

More Excel Tips

Why you NEED to know about Pivot Tables

Refresh all of your Pivot Tables with one click

Delete obsolete items from your Pivot Tables blog post or watch the YOUTUBE video..

excel-formula-crash-course-join-today-v1

 

Barbara

Barbara is an experienced data analyst with over 20 years of experience. Author of the How To Excel At Excel Top 50 Excel tips Ebook, YouTuber and Excel Blogger.

Recent Posts