+ Reply to Thread
Results 1 to 6 of 6

Count values in one column, compared to other columns

  1. #1
    Registered User
    Join Date
    12-13-2012
    Location
    Phoenix, Arizona USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Count values in one column, compared to other columns

    My goal is to isolate rows by counting possible values in one column when compared to other columns.

    I have about 1.5 million individual rows of data and I need to find out which ones have more than one value in column F.

    Basically, in the attached example, I want a count of unique cells in column F (which may be variable) that match column A & B & C & D (which will be constant).

    It seems easy, but I can't wrap my head around this one...

    Please help.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Count values in one column, compared to other columns

    Hi

    And what would be the correct result for ID 1501645 (but only because all the items in B, C, D are the same)? 2 perhaps?

    rylo

  3. #3
    Registered User
    Join Date
    12-13-2012
    Location
    Phoenix, Arizona USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Count values in one column, compared to other columns

    Correct. And for the second series (BRAKE COMPONENTS) there should be 3, (STRUTS & COMPONENTS) would be 2 and the last one (EVAPORATOR & HEATER COMPONENTS) is 1.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Count values in one column, compared to other columns

    Hi

    This is a cumbersome process, but should get you there.

    Using your example file:
    H1:L1 has the values ID, SECTION, GROUP, SUBGROUP AND ILLUSTRATION.
    Select the range A:F, advanced filter, unique, copy to another range, and output to H1:L1 - this should give you unique instances of the items you want.
    Then select columns H:K, advanced filter, unique, another location, and output to N1. This should give you a unique list of the 4 items you want to group.
    R2: =SUMPRODUCT(--($H$2:$H$9=N2),--($I$2:$I$9=O2),--($J$2:$J$9=P2),--($K$2:$K$9=Q2)) Copy down to R5

    As I said, this is for your example file, and the ranges will have to be expanded. Hopefully it will get you there.

    rylo

  5. #5
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Count values in one column, compared to other columns

    Hi

    Another way with a UDF.

    Open a general module in your workbook, and put in the code
    Please Login or Register  to view this content.
    G2: =myfunc($A$2:$A$37,A2,B2,C2,D2)
    G3: =IF(AND(A3=A2,B3=B2,C3=C2,D3=D2),"",myfunc($A$2:$A$37,A3,B3,C3,D3))
    Copy from G3 down to G27

    HTH

    rylo

  6. #6
    Registered User
    Join Date
    12-13-2012
    Location
    Phoenix, Arizona USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Count values in one column, compared to other columns

    rylo, thank you. The second answer is what I needed. I literally have 1.5 million rows that I need to touch. That works great.

    The only thing I won't need is the formula on G3. I want to see the count on each line. You're a pro. Thanks again.

+ 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