+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    02-07-2007
    Location
    Katy, TX
    Posts
    13

    Using =SUMPRODUCT with Multiple Criteria

    I’m having trouble with the following situation. I’m trying to use the following formula to first look in column D (see attached screen capture) for a particular company code, then look in column C for any instances of EH and then from those instances determine how many have Yes in column B.

    =SUMPRODUCT( ('BE - ALL(-TDG)'!$D:$D="1100")+0,ISNUMBER(SEARCH("EH",'BE - ALL(-TDG)'!$C:$C))+0,ISNUMBER(SEARCH("Yes",'BE - ALL(-TDG)'!$B:$B))+0)

    I’ve used my original formula in another workbook successfully (where I looked up a country name and then searched for the number of instances of a contract type) but with only one search:
    =SUMPRODUCT( ('Africa - OPEN'!$A:$A="Libya")+0,ISNUMBER(SEARCH("Emp",'Africa - OPEN'!$F:$F))+0)

    If I’m working in the wrong direction please point me down the correct path.
    Attached Images Attached Images

  2. #2
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,153

    Re: Using =SUMPRODUCT with Multiple Criteria

    Perhaps:
    Code:
    =SUMPRODUCT(('BE - ALL(-TDG)'!$D:$D="1100")*ISNUMBER(SEARCH("EH",'BE - ALL(-TDG)'!$C:$C))*ISNUMBER(SEARCH("Yes",'BE - ALL(-TDG)'!$B:$B)))
    but if only those single text strings found in the cells, then perhaps only:

    Code:
    =SUMPRODUCT(('BE - ALL(-TDG)'!$D:$D="1100")*('BE - ALL(-TDG)'!$C:$C="EH")*'BE - ALL(-TDG)'!$B:$B="Yes")
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    02-07-2007
    Location
    Katy, TX
    Posts
    13

    Re: Using =SUMPRODUCT with Multiple Criteria

    Your first option gave me the same results as the original formula: 0 when it should have been 155. The 2nd option gave me a #value!. Column C contains either "EH" or "COMM" depending upon contract type and column B contains either "Yes" or "No" if space allocations are utilized within the contract. This is WAY out of my comfort zone but I'll keep plugging along.

  4. #4
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,153

    Re: Using =SUMPRODUCT with Multiple Criteria

    How about:

    Code:
    =SUMPRODUCT(--('BE - ALL(-TDG)'!$D:$D="1100"),--('BE - ALL(-TDG)'!$C:$C="EH"),--('BE - ALL(-TDG)'!$B:$B="Yes"))
    or

    Code:
    =SUMPRODUCT(--('BE - ALL(-TDG)'!$D:$D=1100),--('BE - ALL(-TDG)'!$C:$C="EH"),--('BE - ALL(-TDG)'!$B:$B="Yes"))
    If still not successful, attach actual workbook sample, .xls not .jpg..
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #5
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    18,228

    Re: Using =SUMPRODUCT with Multiple Criteria

    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  6. #6
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,153

    Re: Using =SUMPRODUCT with Multiple Criteria

    Thanks JB,

    cbcrocker,

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  7. #7
    Registered User
    Join Date
    02-07-2007
    Location
    Katy, TX
    Posts
    13

    Re: Using =SUMPRODUCT with Multiple Criteria

    Figured it out with the help of Barry Houdini on the MrExcel forum. I'd inadvertantly placed quotes around the 1100. the following would work as well:

    =COUNTIFS('BE - ALL(-TDG)'!$D:$D,1100,'BE - ALL(-TDG)'!$C:$C,"*EH*",'BE - ALL(-TDG)'!$B:$B,"*Yes*")

  8. #8
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,153

    Re: Using =SUMPRODUCT with Multiple Criteria

    Quote Originally Posted by cbcrocker View Post
    Figured it out with the help of Barry Houdini on the MrExcel forum. I'd inadvertantly placed quotes around the 1100. the following would work as well:

    =COUNTIFS('BE - ALL(-TDG)'!$D:$D,1100,'BE - ALL(-TDG)'!$C:$C,"*EH*",'BE - ALL(-TDG)'!$B:$B,"*Yes*")
    That is similar to my second option in my last post.

    Note that the Countifs option only works in 2007.. and if you want to share the file with 2003 users, you need Sumproduct() version.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

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.2.0