+ Reply to Thread
Results 1 to 7 of 7

Count AND show similar values

  1. #1
    Registered User
    Join Date
    02-25-2008
    Posts
    3

    Count AND show similar values

    In column A I've got the following values:

    test1
    test2
    test1
    test1
    test3

    What I would like is for column B to show the unique values of column A:

    test1
    test2
    test3

    In column C I would like to count the number of times a value in B occurs in A. That would be:

    3 (for 'test1')
    1 (for 'test2')
    1 (for 'test3')

    I would use the next formula to count them:
    =COUNT.IF(A1:A100;B1)

    But I would first have to apply a filter to move the unique values of A to B. There isn't a formula available which would do this automatically upon typing values in A?

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by Jexcel
    In column A I've got the following values:

    test1
    test2
    test1
    test1
    test3

    What I would like is for column B to show the unique values of column A:

    test1
    test2
    test3

    In column C I would like to count the number of times a value in B occurs in A. That would be:

    3 (for 'test1')
    1 (for 'test2')
    1 (for 'test3')

    I would use the next formula to count them:
    =COUNT.IF(A1:A100;B1)

    But I would first have to apply a filter to move the unique values of A to B. There isn't a formula available which would do this automatically upon typing values in A?
    How about:

    Please Login or Register  to view this content.
    The first bit of the function identifies the second and subsequent occurrences of non unique values and shows a Null, and shows the count for the first instance.

    HTH

  3. #3
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    You could also use a Pivot Table.
    You'll have all the results in one go

  4. #4
    Registered User
    Join Date
    02-25-2008
    Posts
    3
    What I would like my spreadsheet to look lik is this

    test1 * test1 * 3
    test2 * test2 * 1
    test1 * test3 * 1
    test1 *
    test3 *

    I would input the first column, column 2 would pick the unique values of column 1 and column 3 would test with a countif how many times e.g. B1 would turn up in column A. That last part, the countif, I already have.

    What I like to know if if it's possible for column 2, the unique values, to update itself while typing more values in column 1?

    Or is this only possible with using an advanced filter, so manually after typing all the values in column 1 first?

  5. #5
    Registered User
    Join Date
    02-25-2008
    Posts
    3
    isn't a pivot table just for numbers? (haven 't tried that yet)

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Give the PT a try you will get what you want
    Put your list as column fields and count as Data fields

  7. #7
    Forum Contributor
    Join Date
    02-23-2005
    Location
    England
    Posts
    110
    Assume you start your lists from row 2:

    put following equation into B2 ... =A2
    put following equation into B3 ... =IF(B2="","",IF(VALUE(RIGHT(B2,LEN(B2)-4))<MAX($D$2:$D$9), LEFT($B$2,4)&VALUE(RIGHT(B2,LEN(B2)-4))+1,""))
    copy B3 down as far as you wish/need to go.
    put following equation into C2 ... =COUNTIF($A$2:$A$9,$B2)
    copy C3 down as far as you need/wish to go.
    put following equation into D2 ... =VALUE(RIGHT(A2,LEN(A2)-4))
    copy D2 down as far as you wish to go.

    Adjust the occurrences of $A$2:$A$9 in above equations to suit how far you have gone down column A.
    Adjust the occurrences of $D$2:$D$9 above equations to suit how far you have gone down column D.

+ 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