+ Reply to Thread
Results 1 to 6 of 6

Using the SUMIF() function w/ #DIV/0! errors in range

  1. #1
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164

    Using the SUMIF() function w/ #DIV/0! errors in range

    I have literally tried every formula I know of and criteria to ignore the #DIV/0! errors in the sum range, and I can't seem to figure anything out.

    Here is my current formula:

    =SUMPRODUCT(D5:D16,E5:E16)/SUM(SUMIF(E5:E16,">"&0))

    I'm doing a weighted average of two columns which contain #DIV/0! errors in them (because they are yet to be calculated) and I want to add up the column and ignore or return #DIV/0! errors as zero. Both column D and E contain #DIV/0! errors. I'm not quite sure what is the best method for ignoring errors using the sumproduct formula. I've tried 4 different methods and none have worked for me.

    What is the best approach to this? What am I doing wrong?
    Last edited by Pyrex238; 04-19-2011 at 02:40 PM.

  2. #2
    Registered User
    Join Date
    03-17-2011
    Location
    Illinois
    MS-Off Ver
    2007-2010
    Posts
    22

    Re: Using the SUMIF() function w/ #DIV/0! errors in range

    Try this Pyrex238:
    If there's an error, it will return a blank cell.
    =IF(ISERROR(SUMPRODUCT(D5:D16,E5:E16)/SUM(SUMIF(E5:E16,">"&0))),"",SUMPRODUCT(D5:D16,E5:E16)/SUM(SUMIF(E5:E16,">"&0)))

    or, change the "" to a "0" if you want a zero returned.

    Pete

  3. #3
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164

    Re: Using the SUMIF() function w/ #DIV/0! errors in range

    Quote Originally Posted by Pete123abc View Post
    Try this Pyrex238:
    If there's an error, it will return a blank cell.
    =IF(ISERROR(SUMPRODUCT(D5:D16,E5:E16)/SUM(SUMIF(E5:E16,">"&0))),"",SUMPRODUCT(D5:D16,E5:E16)/SUM(SUMIF(E5:E16,">"&0)))

    or, change the "" to a "0" if you want a zero returned.

    Pete
    Well Pete, I appreciate the help. Unfortunately for some reason that returns nothing but a blank cell for me.

  4. #4
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Using the SUMIF() function w/ #DIV/0! errors in range

    I would go to the source of your #DIV/0! errors and use IFERROR (formula, ""), which will show those missing calculations as blank cells and then (I believe) get treated as if they didn't exist. Also looks better!

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719

    Re: Using the SUMIF() function w/ #DIV/0! errors in range

    You can use this "array formula" to ignore errors of any sort

    =SUM(IF(ISNUMBER(D5:D16*E5:E16),D5:D16*E5:E16))/SUM(IF(ISNUMBER(E5:E16),E5:E16))

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  6. #6
    Forum Contributor
    Join Date
    04-05-2007
    Location
    Arlington, TX
    MS-Off Ver
    Office 2010
    Posts
    164

    Re: Using the SUMIF() function w/ #DIV/0! errors in range

    Quote Originally Posted by daddylonglegs View Post
    You can use this "array formula" to ignore errors of any sort

    =SUM(IF(ISNUMBER(D5:D16*E5:E16),D5:D16*E5:E16))/SUM(IF(ISNUMBER(E5:E16),E5:E16))

    confirmed with CTRL+SHIFT+ENTER
    Ah, the isnumber() works great. Now it's calculating without any problems. Thanks alot daddylonglegs!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1