+ Reply to Thread
Results 1 to 6 of 6

Counting unique entries with conditions

  1. #1
    Registered User
    Join Date
    04-03-2012
    Location
    Stockholm
    MS-Off Ver
    Excel 2003
    Posts
    33

    Counting unique entries with conditions

    Hi,
    I have a data set with 2 columns. One column is filled with names and the other one is filled with numbers.

    A B
    Name 1 20
    Name 1 2
    Name 2 1
    Name 3
    Name 4 2

    I would like to count how many unique names that has >0 (empty cell) . In the example above the desired result should be 3 (Name 3 has empty and Name 1 occurs twice).

    Thanks
    Stefan

  2. #2
    Forum Expert
    Join Date
    09-11-2014
    Location
    Washington, DC
    MS-Off Ver
    2016
    Posts
    1,907

    Re: Counting unique entries with conditions

    Are you willing to use a helper colulmn? If so, paste this into cell C1 and drag down (you can later hide the column):

    Please Login or Register  to view this content.
    Then paste this where you want your count to go:

    Please Login or Register  to view this content.
    Using your example provided, I was able to replicate a count of 3. Hope this helps!
    Spread the love, add to the Rep

    "None of us are as smart as all of us."

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Counting unique entries with conditions

    Try this

    =SUMPRODUCT((A1:A5<>"")*(B1:B5>0)/COUNTIFS(A1:A5,A1:A5,B1:B5,B1:B5&""))

    Row\Col
    A
    B
    C
    D
    1
    Name 1
    20
    4
    2
    Name 1
    2
    3
    Name 2
    1
    4
    Name 3
    5
    Name 4
    2
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Counting unique entries with conditions

    try this
    =SUM((FREQUENCY(INDEX((B1:B6>0)*MATCH(A1:A6,A1:A6,0),0),ROW(A1:INDEX(A:A,ROWS(A1:A6))))>0)*1)
    or
    below array formula
    =SUM(INDEX(IFERROR((B1:B6>0)/COUNTIFS(A1:A6,A1:A6,B1:B6,">"&0),0),0)) please confirm with Shift+Ctrl+Enter
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  5. #5
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Counting unique entries with conditions

    Try this.. as array formula
    PHP Code: 
    =Sum(if(Frequency(if(B1:B6,MATCH(A1:A6,A1:A6,0)),if(B1:B6,MATCH(A1:A6,A1:A6,0),0)),1)) 
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  6. #6
    Registered User
    Join Date
    04-03-2012
    Location
    Stockholm
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Counting unique entries with conditions

    Thanks. I used nflsales array formula and it works. I realised it is important that the lower limit (here A6,B6) is defined correct else it will be wrong. Since I will add rows I hoped to use a lower limit much lower so I guaranteed to include all rows. It does not seem to work. So I will just need to be more careful.

    Thanks again :-)

+ 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] Counting only Unique Entries
    By TheOwlLady in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-18-2013, 09:03 PM
  2. Counting Unique Entries
    By laly in forum Excel General
    Replies: 10
    Last Post: 11-04-2009, 03:50 PM
  3. Counting unique entries
    By sesquiup in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-18-2008, 07:49 PM
  4. Unique Entries with Conditions
    By Rif in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-02-2006, 02:05 AM
  5. [SOLVED] Counting Unique Entries
    By SouthCarolina in forum Excel General
    Replies: 7
    Last Post: 04-14-2006, 08:25 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