+ Reply to Thread
Results 1 to 5 of 5

Counting ID appearances with parameters

  1. #1
    Registered User
    Join Date
    06-26-2009
    Location
    O.o
    MS-Off Ver
    Excel 2003
    Posts
    64

    Counting ID appearances with parameters

    Hi guys,

    Apologies for the poor title, wasnt really sure how to position this worksheet exercise I am totally stuck on.

    I am trying to count the number of times a different ID appears in column 8 with respect to it also matching the same letter in column 1.

    I have attached a worksheet with a couple of examples
    1st. The only ID in column 8 is 990049032 for A in column 1
    2nd. There are two IDs in col. 8 (990054301 and 990043126) for B in column 1


    Truly appreciate any feedback!
    D
    Attached Files Attached Files
    Last edited by dems; 03-21-2010 at 02:08 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Counting ID appearances with parameters

    Hello dems,

    It isn't clear to me from either your post or workbook what results you want . Can you post a sample table showing before and after results?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-26-2009
    Location
    O.o
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Counting ID appearances with parameters

    Hi Leith Ross,

    Attached an answers tab as requested in sheet 2.

    As you can see, the corresponding column D/4 is simply counting the number of different ID numbers (column H/8) appear within all of the IDs which fall under column A/1.

    Struggling to think of the logic to go through and doubting whether excel has a function to support this ultimate goal.

    I really do appreciate help on this. Cheers,
    D
    Attached Files Attached Files

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

    Re: Counting ID appearances with parameters

    I *think* you're saying you want a unique count of Column 8 values per Group in Column 1 ?

    If as implied your data is sorted by Column 1 then perhaps you could get away with:

    D2:
    =IF($A2=$A1,$D1,SUMPRODUCT(($H2:INDEX($H:$H,MATCH($A2,$A:$A))<>"")/COUNTIF($H2:INDEX($H:$H,MATCH($A2,$A:$A)),$H2:INDEX($H:$H,MATCH($A2,$A:$A))&"")))
    copied down

    Note the above would return values where H is blank... this is to reduce calculation burden (ie unique calculation conducted only once per group).

    The use of INDEX to reduce the range size being processed within the SUMPRODUCT itself ... if you really only have a hundred rows of data you could remove the INDEXes and apply the SUMPRODUCT to the entire range adding in a group test, ie:

    D2:
    =IF($A2=$A1,$D1,SUMPRODUCT(--($A2:$A$100=$A2),($H2:$H$100<>"")/COUNTIF($H2:$H$100,$H2:$H$100&"")))
    copied down

  5. #5
    Registered User
    Join Date
    06-26-2009
    Location
    O.o
    MS-Off Ver
    Excel 2003
    Posts
    64

    Re: Counting ID appearances with parameters

    Wow awesome, works perfect. Just wish i totally understood how it worked

    Quote Originally Posted by DonkeyOte View Post
    I *think* you're saying you want a unique count of Column 8 values per Group in Column 1 ?

    If as implied your data is sorted by Column 1 then perhaps you could get away with:

    D2:
    =IF($A2=$A1,$D1,SUMPRODUCT(($H2:INDEX($H:$H,MATCH($A2,$A:$A))<>"")/COUNTIF($H2:INDEX($H:$H,MATCH($A2,$A:$A)),$H2:INDEX($H:$H,MATCH($A2,$A:$A))&"")))
    copied down

    Note the above would return values where H is blank... this is to reduce calculation burden (ie unique calculation conducted only once per group).

    The use of INDEX to reduce the range size being processed within the SUMPRODUCT itself ... if you really only have a hundred rows of data you could remove the INDEXes and apply the SUMPRODUCT to the entire range adding in a group test, ie:

    D2:
    =IF($A2=$A1,$D1,SUMPRODUCT(--($A2:$A$100=$A2),($H2:$H$100<>"")/COUNTIF($H2:$H$100,$H2:$H$100&"")))
    copied down

+ 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