Closed Thread
Results 1 to 6 of 6

Thread: Count Unique values with vlookup

  1. #1
    Registered User
    Join Date
    07-06-2007
    Posts
    35

    Count Unique values with vlookup

    Hi there, I need some help with counting unique values if two other values match using vLookup or if statement.

    I have two worksheets. (See attached example).

    In column titled “No of Suppliers” in the worksheet “Lookup”, I need to count the number of unique values from column “Suppliers” of worksheet “Data” if Destination City in “Lookup” matches with Destination City in
    “Data”.

    I have done this manually in the attached example.

    Hope this makes sense and someone can help me please.

    gsrai31
    Attached Files Attached Files

  2. #2
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,057
    You can use this formula in B2 copied down

    =SUM(IF(FREQUENCY(IF(Data!A$2:A$10=A2,MATCH( Data!B$2:B$10,Data!B$2:B$10,0)),ROW(Data!B$2:B$10)-ROW(Data!B$2)+1),1))

    Note: this is an "array formula" which needs to be confirmed with CTRL+SHIFT+ENTER so that curly braces like { and } appear around the formula in the formula bar

  3. #3
    Registered User
    Join Date
    07-06-2007
    Posts
    35

    Count Unique values with vlookup

    Excellent!! Many thanks for your help.

  4. #4
    Registered User
    Join Date
    08-28-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Count Unique values with vlookup

    Quote Originally Posted by gsrai31 View Post
    Excellent!! Many thanks for your help.

    Bkwaass, it doesnt work

  5. #5
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2007
    Posts
    10,057

    Re: Count Unique values with vlookup

    Quote Originally Posted by REDDY1234 View Post
    Bkwaass, it doesnt work
    Given gsrai31's response to my suggestion I suspect it does work - why do you say it doesn't?
    Audere est facere

  6. #6
    Extremely Helpful member
    Join Date
    12-23-2006
    Location
    Belgium
    MS-Off Ver
    XL2003
    Posts
    6,127

    Re: Count Unique values with vlookup

    Reddy

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Quoting entire posts clutters the forum and makes threads hard to read !

    If you are pleased with a member's answer then use the Star icon to rate it

    Click here to see forum rules

Closed 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.2.0