+ Reply to Thread
Results 1 to 11 of 11

Counting Unique Values with Multiple Criteria

  1. #1
    Registered User
    Join Date
    02-14-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    5

    Counting Unique Values with Multiple Criteria

    PLEASE HELP! i have been working on this for days

    I need to find the number of Unique Customer accounts associated with certain criterias......


    For example i need to see how many see how many unique customer Id's have bougth form us if OEM NAme is "1" The Team is "LOB",the Date entered is "PRE" and the status is "PO"

    Mind you i have 222,222 Rows i am working with


    Status Data Entered OEM Name Teams Company ID
    PO PRE 1 LOB 55
    NS POST 5 Tournoux 66
    RTN PRE 6 Balsdeasari 55
    NS POST 9 LOB 88
    PO PRE 8 Tournoux 99
    NS POST 7 Balsdeasari 2
    RTN POST 4 LOB 8
    NS PRE 1 Tournoux 4
    PO POST 3 Balsdeasari 9
    NS PRE 10 LOB 17
    RTN POST 11 Tournoux 1458
    NS POST 2 Balsdeasari 9
    PO PRE 6 Balsdeasari 408
    NS POST 6 LOB 446
    RTN PRE 7 Tournoux 485
    NS POST 7 Balsdeasari 524
    PO POST 7 LOB 563
    NS PRE 7 Tournoux 601
    RTN POST 7 Balsdeasari 640
    NS PRE 7 Balsdeasari 679
    PO POST 7 LOB 718
    NS POST 7 Tournoux 756
    RTN PRE 8 Balsdeasari 795
    NS POST 8 LOB 834
    PO PRE 8 Tournoux 873
    NS POST 8 Balsdeasari 911
    RTN POST 8 Balsdeasari 950
    NS PRE 8 LOB 989
    PO POST 8 Tournoux 1028
    NS PRE 8 Balsdeasari 1066
    RTN POST 9 LOB 1105
    NS POST 9 Tournoux 1144
    PO PRE 9 Balsdeasari 1183
    NS POST 9 Balsdeasari 1221
    RTN PRE 9 LOB 1260
    NS POST 9 Tournoux 1299
    PO POST 9 Balsdeasari 1338
    NS PRE 9 LOB 1376

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

    Re: Counting Unique Values with Multiple Criteria

    222000+ rows might be a bit hefty, but you can try:

    Please Login or Register  to view this content.
    adjust ranges and confirm with CTRL+SHIFT+ENTER not just ENTER.
    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
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Counting Unique Values with Multiple Criteria

    If this is a once-off deal, you could apply a filter, then hi-light the remaining data, look at the bottom of the screen, it will tell you the count.
    If this is an ongoing process, NBVC's option is better
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Valued Forum Contributor
    Join Date
    07-29-2009
    Location
    Belgium
    MS-Off Ver
    Excel 2003/Excel 2010
    Posts
    534

    Re: Counting Unique Values with Multiple Criteria

    Might be interesting to check if a UDF is faster over such a huge range.Example in attachment just covers the data from post #1.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-14-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Counting Unique Values with Multiple Criteria

    i would really liek to keep this to a Formula but i am still having a hard time get it just right. i haver attached what would be the basic format for the finall report maybe this will help with the formula

    [atch]Book2[/attach]

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

    Re: Counting Unique Values with Multiple Criteria

    Didn't attach properly.

    To attach a file to your post, you need to be using the main 'New Post' or 'New Thread' page and not 'Quick Reply'.
    To use the main 'New Post' page, click the 'Post Reply' button in the relevant thread.

    On this page, below the message box, you will find a button labelled 'Manage Attachments'.
    Clicking this button will open a new window for uploading attachments.

    You can upload an attachment either from your computer or from another URL by using the appropriate box on this page.
    Alternatively you can click the Attachment Icon to open this page.

    To upload a file from your computer, click the 'Browse' button and locate the file.

    To upload a file from another URL, enter the full URL for the file in the second box on this page.
    Once you have completed one of the boxes, click 'Upload'.

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  7. #7
    Registered User
    Join Date
    02-14-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    5

    Counting Unique Values with Multiple Criteria

    here is the attachment.. i thnak youy for all your help ...new to this !
    Attached Files Attached Files

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

    Re: Counting Unique Values with Multiple Criteria

    Are there going to actually be duplicate company id's with all the same criteria? Because with 222,000+ posts, having that many array formulas is going to be very slow.... if they are not repeated, we can use COUNTIFS which is very efficient.

  9. #9
    Registered User
    Join Date
    02-14-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Counting Unique Values with Multiple Criteria

    Unfortunalely there will actually be many duplicates, but i can trim the rows down to about 90,000... you think that might help?

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

    Re: Counting Unique Values with Multiple Criteria

    In F2 add a helper formula:

    =SUBSTITUTE(A2&"_"&B2&"_"&ROUND(C2,0)&"_"&D2,CHAR(32),"")

    then in

    Please Login or Register  to view this content.
    confirmed with CTRL+SHIFT+ENTER not just ENTER copied down to H11 and to next column.

    If you get all 0's, make sure that all the headers in G4:G27 and H3:I3 have no extra spaces at the end.

    copy formula to H13 and H21 and make necessary change to the $G$4 reference for the correct Teams header.

  11. #11
    Registered User
    Join Date
    02-14-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Counting Unique Values with Multiple Criteria

    I got it ot work with a smaller amount of Data but with the amount i am using it just Crashes Excell ..... i will have to use Pivot Tables i guess. Thank you So much for all your help !!!!!!!!!!!!!!!!!!

+ 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