+ Reply to Thread
Results 1 to 6 of 6

merging countif and sumproducts

  1. #1
    Registered User
    Join Date
    12-20-2010
    Location
    toronto, canada
    MS-Off Ver
    Excel 2003
    Posts
    5

    merging countif and sumproducts

    Is there any way to merge these two formulas?
    =COUNTIF(Active!$A$2:$A$426,"*construction*")
    =SUMPRODUCT((Active!$G$2:$G$426>=11)*(Active!$G$2:$G$426<=20))
    Last edited by NBVC; 12-20-2010 at 04:56 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: mergine count and sumproducts

    Perhaps:

    =SUMPRODUCT(ISNUMBER(SEARCH("construction",Active!$A$2:$A$426)*(Active!$G$2:$G$426>=11)*(Active!$G$2:$G$426<=20))
    Where there is a will there are many ways.

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

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

  3. #3
    Registered User
    Join Date
    12-20-2010
    Location
    toronto, canada
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: merging countif and sumproducts

    =SUMPRODUCT(((Active!$G$2:$G$426>=6)*(Active!$G$2:$G$426<=10))--(Active!$A$2:$A$426="*construction*"))

    Thank you so much for your suggestion however it is not picking up the second half. I get the same count as if the filter by construction was not there.

    s

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: merging countif and sumproducts

    That doesn't look like my suggestion.

    Although, I did forget one closing parenthesis.

    Try this formula:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-20-2010
    Location
    toronto, canada
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: merging countif and sumproducts

    Thank you, It did work this time.

    I appreciate it very much!

    I was still trying to work with what i knew when it did not work the first time.

    =SUMPRODUCT(--(Active!G2:G426>=11)*(Active!G2:G426<=20),--(Active!A2:A426="Cable Construction Locate"))

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: merging countif and sumproducts

    There is no need to mix -- with * in the Sumproduct() function.. it's one or the other... and that might also depend on how your ranges are setup and the content.

    Also, Sumproduct does not accept wildcards, so you need to use LEFT/RIGHT/MID functions if you know the location of the substring or ISNUMBER(SEARCH()) if the substring could be anywhere within the string as implied with *construction*

+ 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