+ Reply to Thread
Results 1 to 5 of 5

Adding =countif to an =sumproduct range (Maybe)

  1. #1
    Forum Contributor
    Join Date
    12-17-2008
    Location
    Vernon, CT
    Posts
    132

    Question Adding =countif to an =sumproduct range (Maybe)

    I am having an issue with my formula. =SUMPRODUCT((A2:A2000=D3)*(B2:B2000)) The formula works great except I need to add countif greater than 0 to this and I can't figure out how. The issue is (Attached), that in cell D3 if you have nothing entered (This is what the user would search by), it (E3) will count every customer with a 0 ship to in column A. I want to ignore those. Also, the info that is in columns A & B will be added from another program (iSeries navigator). These numbers are not manually entered. Only D3 would be for the user.

    Thanks for any help,

    Jay
    Attached Files Attached Files
    Last edited by jayclinton; 10-19-2011 at 08:45 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Adding =countif to an =sumproduct range (Maybe)

    So would you want to see a total of 8 if a zero is actually entered in D3? Assuming so then you can use an IF function to return a blank when D3 is blank....and you probably only need SUMIF, like this

    =IF(D3="","",SUMIF(A:A,D3,B:B))
    Audere est facere

  3. #3
    Forum Contributor
    Join Date
    12-17-2008
    Location
    Vernon, CT
    Posts
    132

    Re: Adding =countif to an =sumproduct range (Maybe)

    Awesome!! That was so much easier. Thanks!!

  4. #4
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Adding =countif to an =sumproduct range (Maybe)

    =SUMPRODUCT((A2:A2000=D3)*(A2:A2000<>0)*(B2:B2000)) maybe
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  5. #5
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Adding =countif to an =sumproduct range (Maybe)

    Quote Originally Posted by jayclinton View Post
    that in cell D3 if you have nothing entered (This is what the user would search by), it (E3) will count every customer with a 0 ship to in column A. I want to ignore those
    Jay

    I'm a little confused, if there's nothing in D3, ie blank are you counting that in the same way as 0? if you want to ignore 0 and blank =SUMPRODUCT((A2:A2000=D3)*(A2:A2000<>0)*(A2:A2000<>"")*(B2:B2000)) but if you want to keep the option of summing if the 0 is entered

    =SUMPRODUCT((A2:A2000=D3)*(A2:A2000<>"")*(B2:B2000))

+ 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