+ Reply to Thread
Results 1 to 4 of 4

Thread: Count If Unique -- help

  1. #1
    Registered User
    Join Date
    08-03-2011
    Location
    Kansas City, Missiouri
    MS-Off Ver
    Excel 2010
    Posts
    2

    Count If Unique -- help

    Hey all,

    I need some help with this problem --I'm sure it's much simpler than I realize, but here it is:

    I need to count the number of unique items in a column. Example:

    ----- A
    1 -- 1213
    2 -- 1213
    3 -- 5228
    4 -- 2217

    In this simple table there are 4 rows but only 3 different types of numbers (1213, 5228 & 2217). I need a formula that counts repeating text/numbers only once.

    Does anyone have any thoughts?

  2. #2
    Forum Guru Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    2003, 2007 and 2010
    Posts
    1,207

    Re: Count If Unique -- help

    Welcome to the forum.

    If the range contains only numbers you can use this formula:
    =SUMPRODUCT(--(FREQUENCY(A1:A4,A1:A4)>0))

    If the range contains a mixture of numbers and text you can use this formula (this is an array formula so when you type it into the formula bar you must complete the entry with CTRL+SHIFT+ENTER, not just ENTER):
    =SUM(IF(FREQUENCY(IF(A1:A4<>"",MATCH("~"&A1:A4,A1:A4&"",0)),ROW(A1:A4)-ROW(A1)+1),1))

    Both sourced from here.
    Hope that helps,

    Colin

    RAD Excel Blog

    Other tutorials:
    Array Formulas | Deleting Rows with VBA

  3. #3
    Cheeky Forum Moderator Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2003, 2007, 2010
    Posts
    3,711

    Re: Count If Unique -- help

    This regular formula counts the unique items (text or numeric)
    =SUMPRODUCT((A1:A10<>"")/COUNTIF(A1:A10,A1:A10&""))

    Is that something you can work with?
    Regards,

    Ron
    Microsoft MVP - Excel
    (Oct 2006 - Sep 2012)

    Click here to see the Forum Rules

  4. #4
    Registered User
    Join Date
    08-03-2011
    Location
    Kansas City, Missiouri
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Count If Unique -- help

    This worked.


    Thanks so much,

    exceldave84

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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