+ Reply to Thread
Results 1 to 11 of 11

COUNTIFS unique values

  1. #1
    Forum Contributor
    Join Date
    02-14-2008
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    110

    COUNTIFS unique values

    Hello

    Hoping someone can help. I have the following formula

    =COUNTIFS(Sheet1!$Y:$Y,Sheet1!$Q:$Q,G$6)

    Column Y contains 100 of names but I only want to count the unique number. How can I change this formula?

    Thanks in advance

    Dan

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: COUNTIFS unique values

    Hi,

    This array formula should work for you:

    =SUM(IF(FREQUENCY(IF(LEN(A:A)>0,MATCH(A:A,A:A,0),""), IF(LEN(A:A)>0,MATCH(A:A,A:A,0),""))>0,1))

    Confirm with CTRL, SHIFT and ENTER.

    Note that using whole columns is very inefficient and will slow down your sheet significantly. Consider using a dynamic named range to reduce resource gobbling!
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

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

    Re: COUNTIFS unique values

    attach a sample file
    Samba

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

  4. #4
    Forum Contributor
    Join Date
    02-14-2008
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    110

    Re: COUNTIFS unique values

    Hi Sweep

    Does this also incorporate the second part of my formula though where column Q needs to match G6?

    Thanks

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: COUNTIFS unique values

    Sorry I misunderstood,

    but I only want to count the unique number
    To confirm, you want to count how many unique entries are in column Y when column Q matches G6?

  6. #6
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: COUNTIFS unique values

    Sorry I misunderstood,

    but I only want to count the unique number
    To confirm, you want to count how many unique entries are in column Y when column Q matches G6?

  7. #7
    Forum Contributor
    Join Date
    02-14-2008
    Location
    Manchester, England
    MS-Off Ver
    2007
    Posts
    110

    Re: COUNTIFS unique values

    No probs Sweep.

    Yes how many unique names appear in column Y when column Q matches G6

    Thanks

  8. #8
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454

    Re: COUNTIFS unique values

    OK,

    try this array function:

    =SUM(IF(FREQUENCY(IF($Q$1:$Q$24=$G$6,MATCH($Y$1:$Y$24,$Y$1:$Y$24,0)),ROW($Y$1:$Y$24)-ROW($Y$1)+1)>0,1))

  9. #9
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: COUNTIFS unique values

    Array Formula - Requires CTRL+SHIFT+ENTER



    =SUM((Sheet1!$Q1:$Q10=G$6)*IFERROR(1/COUNTIF(Sheet1!$Y1:$Y10,Sheet1!$Y1:$Y10),0))



    Array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  10. #10
    Forum Contributor
    Join Date
    12-19-2013
    Location
    Philadelphia
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: COUNTIFS unique values

    Sixth sense, can you show what the array would look like if I just need to count the unique names in a range (1 column)

  11. #11
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: COUNTIFS unique values

    Array Formula - Requires CTRL+SHIFT+ENTER


    =SUM(IFERROR(1/COUNTIF(Q1:$Q10,Q1:$Q10),0))


    Array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

+ 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. countifs for unique values
    By rbenguerel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-31-2014, 07:57 AM
  2. COUNTIFS criteria to specify unique values
    By Boatryte in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-17-2014, 04:05 PM
  3. COUNTIFS with Unique Values
    By lefteegunzz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-23-2013, 04:25 PM
  4. Countifs with unique values & dates
    By lanos in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-26-2012, 09:11 AM
  5. Excel 2007 : Using countifs to count unique values
    By AlexZoom in forum Excel General
    Replies: 2
    Last Post: 09-23-2010, 09:41 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