+ Reply to Thread
Results 1 to 6 of 6

count unique text values with criteria in different column

  1. #1
    Registered User
    Join Date
    05-31-2012
    Location
    Hobart
    MS-Off Ver
    Excel 2003
    Posts
    7

    count unique text values with criteria in different column

    Hi folks

    Trying to design a formula that outputs me the number of unique values (text & numbers, but ignoring blanks) from col B. However it should only count unique values that have the value "y" in column A. Any value in column B which has "n" in column A should be ignored in the count. Example file is attached.

    I managed to get the formula for counting without the criteria based on column A:
    =SUM(IF(FREQUENCY(IF(LEN(B1:B13)>0,MATCH(B1:B13,B1:B13,0),""), IF(LEN(B1:B13)>0,MATCH(B1:B13,B1:B13,0),""))>0,1))

    But I can not figure out how to include the criteria to only count values in column B if they are "y" in column A.
    Btw I`m using Excel 2010.

    Cheers
    Alohaey

    example file.xlsx

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: count unique text values with criteria in different column

    Try:

    Please Login or Register  to view this content.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: count unique text values with criteria in different column

    Hi and welcome to the forum.

    An easy way to do this, is using a helper & hidden column(Let's say C)

    sO IN c2 and copy down put this.

    =COUNTIF(B2:B3,B2)

    Then, use this formula to get your result.

    =COUNTIFS(A2:A13,"y",C2:C13,1)

    Is this, works, for you?
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: count unique text values with criteria in different column

    Fotis, it's better to use =COUNTIF(B$2:B2,B2) since you don't depend on order in column.

    But no matter of that, your solution probably won't work because it assuming that y is in last instance of unique word, and that don't need to be true.
    (i.e. out n in A3)

  5. #5
    Registered User
    Join Date
    05-31-2012
    Location
    Hobart
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: count unique text values with criteria in different column

    Wow I`m impressed. That were probably the fastest responses I ever got in a forum and with exactly the answer I was looking for. Thank heaps to both of you.
    Alohaey

  6. #6
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: count unique text values with criteria in different column

    @ zbor.

    So, in this case, you are right

    @ Alohaey

    So you have only one solution. But very good!

+ 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