+ Reply to Thread
Results 1 to 5 of 5

Count unique values based on value in another cell in same row

  1. #1
    Registered User
    Join Date
    10-31-2012
    Location
    Leeds, UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Count unique values based on value in another cell in same row

    Hi folks,

    We have a spreadsheet of people, each have a number unique to them in column B, they can appear in the list more than once. There is a Yes or No on each row in Column AL, sometimes the value in AK is assumed, sometimes an actual value. I need to know the number of individual people for Yes and also for No.

    So, I am trying to count the number of unique reference numbers in column B from 5 onwards that also have an answer "Yes" on the same row in column AL, then separately counting the "No" rows. I can use
    {=SUM(IF(FREQUENCY(B5:B9999,B5:B9999)>0,1))} or
    {=SUM(IF(FREQUENCY(IF(LEN(B5:B9999)>0,MATCH(B5:B9999,B5:B9999,0),""), IF(LEN(B5:B9999)>0,MATCH(B5:B9999,B5:B9999,0),""))>0,1))}
    to count how many unique reference numbers in column B. I have looked at a thread from 2009 but couldn't make anything work to count only the Yes or No rows.

    Help please, thanks in advance.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Count unique values based on value in another cell in same row

    Hi and welcome to the forum

    You could probably do this wil 1 (or 2) helper columns, using countif()?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Count unique values based on value in another cell in same row

    self-deleted duplicate post
    Last edited by FDibbins; 08-07-2013 at 12:55 PM.

  4. #4
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Count unique values based on value in another cell in same row

    without a sample file, the best i can conjecture is the following (untested) construct - ARRAY entered:

    Please Login or Register  to view this content.
    UPDATE:

    based on your sample file from below, the ARRAY-formula for counting unique values would be...

    for "Yes":

    Please Login or Register  to view this content.
    for "No":

    Please Login or Register  to view this content.
    just FYI - if you are using Column B (Ref) to count uniques, then the formula is much simpler and you do not have to use MATCH; since the column contains numbers, FREQUENCY function can handle it very well. only in the case of textual strings, MATCH needs to be employed.
    Last edited by icestationzbra; 08-08-2013 at 07:19 AM.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  5. #5
    Registered User
    Join Date
    10-31-2012
    Location
    Leeds, UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Count unique values based on value in another cell in same row

    Thanks for the replies, and apologies I should have said we use Excel 2003.

    Thanks icestationzebra, it gives an answer but I'm not sure the number is correct. It doesn't look right compared to the toal number of unique people.

    I have attached a file with a sample of the kind of data.

    thanks for your time

    unique.xls

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] count unique values based on unique values
    By neetu.aggarwal in forum Excel General
    Replies: 13
    Last Post: 10-23-2012, 04:00 AM
  2. Count unique values and create list based on these values
    By Alan Beban in forum Excel Formulas & Functions
    Replies: 42
    Last Post: 09-06-2005, 07:05 PM
  3. Count unique values and create list based on these values
    By vipa2000 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  4. Count unique values and create list based on these values
    By Alan Beban in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 09-06-2005, 02:05 PM
  5. [SOLVED] Count unique values and create list based on these values
    By vipa2000 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM

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