+ Reply to Thread
Results 1 to 10 of 10

Multiple criteria countif or sumproduct

  1. #1
    Registered User
    Join Date
    09-16-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Multiple criteria countif or sumproduct

    I haven't been this deep into excel before. The deeper I look, the more potential I recognize, the more amazed I get. That being said, I have come to a tough count issue. Let me attempt to explain as precisely as possible.

    My current worksheet is large but I am only particularly concerned with two columns of information (Regions) and (Days). The logic I am attempting is something along the lines of Count If Region = East, or West, and Days is greater than 0, less than 60.

    I am open to any and all suggestions on how to tackle this situation. I have been able to achieve similar counts by using pivot tables but the dynamic nature of these two columns presents some difficulties that my “new user” mind has been unable to work through.

    Any thoughts or suggestions?

    Thanks,
    Justin
    Last edited by NBVC; 09-16-2009 at 04:58 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: Need some guidance with multiple criteria countif or sumproduct arrray, or combo

    Try

    =Sumproduct(((Region_range="EAST")+(Region_range="West")),--(Days_Range>0),--(Days_range<60))

    subbing actual ranges...
    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
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Need some guidance with multiple criteria countif or sumproduct arrray, or combo

    Something like this:

    Book1.xls

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Need some guidance with multiple criteria countif or sumproduct arrray, or combo

    My current worksheet is large but I am only particularly concerned with two columns of information (Regions) and (Days).
    Depending on volume of data and indeed calcs to be performed it may be that SUMPRODUCT / Arrays will prove costly in terms of the overall performance of your file - if that becomes a reality then let us know and we can investigate other methods... if your conditional calcs are few and far between then a SUMPRODUCT based approach is certainly an excellent option.

  5. #5
    Registered User
    Join Date
    09-16-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Need some guidance with multiple criteria countif or sumproduct arrray, or combo

    Thanks for the replies. I am working through the suggestions now. I am attempting to use the first suggestion and I am getting a #Value error. I currently have

    {=SUMPRODUCT((('Entire Sites - Offices - Staff'!B5:B99="Northern Oklahoma District")+('Entire Sites - Offices - Staff'!B5:B99="*Rocky Mountain District*")),--('Entire Sites - Offices - Staff'!G5:G100>0),--('Entire Sites - Offices - Staff'!G5:G83<60))}


    Entered by hitting shift cnrl enter.
    Does pulling data from a different worksheet cause problems?

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Need some guidance with multiple criteria countif or sumproduct arrray, or combo

    No need for CSE...

    Your #VALUE! error will (most likely) be result of fact your final 2 ranges are of different dimension to remainder - ie should both be G5:G99 rather than G5:G100 / G5:G83, when using double unary (--) method all ranges should be of equal dimensions.
    Last edited by DonkeyOte; 09-16-2009 at 02:18 PM.

  7. #7
    Registered User
    Join Date
    09-16-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Need some guidance with multiple criteria countif or sumproduct arrray, or combo

    Thanks for the reply! So close now. I am now returning a 0. Everything looks good and I am wondering if the database that generates the data is giving me some kind of formatting that is causing problems. I verified that the numbers are numbers and not text. Think of anything else to double check?

    Thanks again!

    Current line returning 0 Should be returning 5 or more.

    =SUMPRODUCT((('Entire Sites - Offices - Staff'!B5:B99="Northern Oklahoma District")+('Entire Sites - Offices - Staff'!B5:B99="Rocky Mountain District")),--('Entire Sites - Offices - Staff'!G5:G99>0),--('Entire Sites - Offices - Staff'!G5:G99<60))

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

    Re: Multiple criteria countif or sumproduct

    Try selecting G5:G99 and go to Data|Text to Columns and click Finish.

    Does that fix it?

    If no, make sure the B5:B99 entries don't have extra spaces in any cells...

  9. #9
    Registered User
    Join Date
    09-16-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Multiple criteria countif or sumproduct

    Thanks, it seems to be working now. I copied and pasted the same line into a different cell and it seems to be working just fine. Thanks for all the help. This is a great forum.

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

    Re: Multiple criteria countif or sumproduct

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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