+ Reply to Thread
Results 1 to 5 of 5

Number of different values in a range

  1. #1
    Registered User
    Join Date
    05-17-2006
    Posts
    9

    Number of different values in a range

    Hello everyone,

    Let's say I have a range A1:A1000, each cell containig a natural number.
    For my purposes these values are OK if and only if they are all different.
    Is there an easy way to count the number of different cells in a range?

    Many thanks!

  2. #2
    Bob Phillips
    Guest

    Re: Number of different values in a range

    =SUMPRODUCT((A2:A1000<>"")/COUNTIF(A2:A1000,A2:A1000&""))


    --
    HTH

    Bob Phillips

    (replace somewhere in email address with googlemail if mailing direct)

    "Lucas Lehmer" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > Hello everyone,
    >
    > Let's say I have a range A1:A1000, each cell containig a natural
    > number.
    > For my purposes these values are OK if and only if they are all
    > different.
    > Is there an easy way to count the number of different cells in a
    > range?
    >
    > Many thanks!
    >
    >
    > --
    > Lucas Lehmer
    > ------------------------------------------------------------------------
    > Lucas Lehmer's Profile:

    http://www.excelforum.com/member.php...o&userid=34514
    > View this thread: http://www.excelforum.com/showthread...hreadid=545853
    >




  3. #3
    Ardus Petus
    Guest

    Re: Number of different values in a range

    =SUM(IF(COUNTIF(A1:A1000,A1:A1000)>1,1))
    Array formula, to be validated with Ctrl+Shift+Enter
    will return the number of dupes

    HTH
    --
    AP


    "Lucas Lehmer" <[email protected]> a
    écrit dans le message de news:
    [email protected]...
    >
    > Hello everyone,
    >
    > Let's say I have a range A1:A1000, each cell containig a natural
    > number.
    > For my purposes these values are OK if and only if they are all
    > different.
    > Is there an easy way to count the number of different cells in a
    > range?
    >
    > Many thanks!
    >
    >
    > --
    > Lucas Lehmer
    > ------------------------------------------------------------------------
    > Lucas Lehmer's Profile:
    > http://www.excelforum.com/member.php...o&userid=34514
    > View this thread: http://www.excelforum.com/showthread...hreadid=545853
    >




  4. #4
    RagDyeR
    Guest

    Re: Number of different values in a range

    Try this:

    =SUMPRODUCT((A1:A1000<>"")/COUNTIF(A1:A1000,A1:A1000&""))

    --

    HTH,

    RD
    =====================================================
    Please keep all correspondence within the Group, so all may benefit!
    =====================================================

    "Lucas Lehmer" <[email protected]>
    wrote in message
    news:[email protected]...

    Hello everyone,

    Let's say I have a range A1:A1000, each cell containig a natural
    number.
    For my purposes these values are OK if and only if they are all
    different.
    Is there an easy way to count the number of different cells in a
    range?

    Many thanks!


    --
    Lucas Lehmer
    ------------------------------------------------------------------------
    Lucas Lehmer's Profile:
    http://www.excelforum.com/member.php...o&userid=34514
    View this thread: http://www.excelforum.com/showthread...hreadid=545853



  5. #5
    Registered User
    Join Date
    05-17-2006
    Posts
    9
    Ok, guys.

    Problem solved!
    Thanks again, have a nice day!

+ 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