The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,832 other followers

How to aggregate (count/sum/average) cells and ignore the #div/0! ‘s – via: list of functions by Excel version

Posted by jpluimers on 2015/11/19

I bumped into a #DIV/0! result for average functions when processing large sets of data.

It is actually very easy to spot the error in small results, sets, but hard in big ones, as you cannot see the #DIV/0!

So there are average functions that can ignore certain outcomes. COUNT already does that (there is no COUNTIF), the others have a *IF equivalent, but not in all Excel versions:

Note there is a small SUMIF/SUMIFS/AVERAGEIF/AVERAGEIFS in Excel 2010 (not in 2007, and maybe not in 2013) glitch when the criteria are in a different sheet.

The seemingly easy workaround of summing columns A and B, then doing the division fails: it returns different results as it forgets to ignore faulty rows:

SUM/AVERAGE versus SUMIF/AVERAGEIF (click to enlarge)

SUM/AVERAGE versus SUMIF/AVERAGEIF (click to enlarge)

Leermomentje (techable moment comes close)…

–jeroen

via:

2 Responses to “How to aggregate (count/sum/average) cells and ignore the #div/0! ‘s – via: list of functions by Excel version”

  1. Alex Powers said

    Any reason why you don’t use the =IFERROR to mask the Divide By Zero error?

    • jpluimers said

      As I wanted to specifically catch the division by zero. IFERROR catches all. I want to know the causes of errors, so I can track it back to source data errors.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: