+ Reply to Thread
Results 1 to 9 of 9

Count amount of diff values in column

  1. #1
    Registered User
    Join Date
    11-04-2009
    Location
    tuvieja
    MS-Off Ver
    Excel 2003
    Posts
    6

    Count amount of diff values in column

    Hi all,

    I need help with counting unique values in a column, taking into consideration info from another column.

    Input example:

    Column A _________ Column B
    Ford _____________ John
    Mustang __________ Mike
    Honda ____________ Ralph
    GM _______________ Ralph
    Ford ______________ Matt
    Mustang __________ Ralph
    Ford ______________ Carl
    Mustang ___________ Robert
    Ford _______________ Ralph
    Honda ______________ Ralph
    Honda ______________ Ralph
    GM _________________ Carl


    As seen in the output below, I need a table with each brand in column A, and how many DIFFERENT people matches the data in column B


    Output example:

    Column A ____________ Column B
    Ford ________________ 4
    Mustang _____________ 3
    Honda _______________ 1
    GM __________________ 2

    As shown in this example, all the "Honda"s in column A are assigned to only 1 person (Ralph) so column B must say "1"

    Id appreciate any help you can provide me with this.

    (Sorry if the explanation is not clear enough, english is not my native language)

    Regards.
    Last edited by gamuzadt; 11-10-2009 at 01:10 PM. Reason: issue solved

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Count amount of diff values in column

    Have you considered using a Pivot Table?
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

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

    Re: Count amount of diff values in column

    You can use either a FREQUENCY array or a SUMPRODUCT along the lines of the below

    Please Login or Register  to view this content.
    where A1 holds Ford etc...
    (you may need to alter delimiters from , to ; pending your locale)

    re: Pivot Table - won't give a unique count per se.

  4. #4
    Registered User
    Join Date
    11-04-2009
    Location
    tuvieja
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Count amount of diff values in column

    Tried too, but im kind of new to pivot tables, where should I drag the fields to?

    Thanks for the quick response.

  5. #5
    Forum Expert MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    2,650

    Re: Count amount of diff values in column

    Hi, Try this, Result start Column "D".
    Please Login or Register  to view this content.
    Regards Mick

    PS:-To Run Code.
    Right Click Sheet Tab , Select "View Code" , (VB Window appears.)
    On VB Window ToolBar, Click "Insert", "Module", (New Window appears.)
    Paste Code In New Window..
    Close VB Window.
    In WorkSheet Click "Alt+F8" Macro Dialog Box Appears.
    Select Code From List, Click "Run", On R/H/S of Dialog Box
    Code should now be Executed.
    Last edited by MickG; 11-05-2009 at 10:28 AM.

  6. #6
    Registered User
    Join Date
    11-04-2009
    Location
    tuvieja
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Count amount of diff values in column

    I think DonkeyOte's way will work for now, thanks everyone for the fast response!

  7. #7
    Registered User
    Join Date
    11-04-2009
    Location
    tuvieja
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Count amount of diff values in column

    Quote Originally Posted by gamuzadt View Post
    I think DonkeyOte's way will work for now, thanks everyone for the fast response!
    I have a problem, this method works but is also counting blank spaces. Is there a way to prevent this from happening?

    Regards,

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

    Re: Count amount of diff values in column

    Can you post an example illustrating the fact ?

    I presume you mean you have criteria values listed in A without any associated value in B ? If so:

    Please Login or Register  to view this content.
    If you mean that you get a result even if criteria is blank then add a pre-emptive IF to the function as a whole, eg:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    11-04-2009
    Location
    tuvieja
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Count amount of diff values in column

    You presumed correctly, first method worked.
    DonkeyOte, thanks a lot!

+ 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