+ Reply to Thread
Results 1 to 3 of 3

Formula to count the number of different values in a range

  1. #1
    PCLIVE
    Guest

    Formula to count the number of different values in a range

    I'm looking for a formula that will give me the number of different values
    in a range.

    Example: Column A may have five cells that are "4", five cells that are
    "7", five cells that are "9". Of the fifteen cells that contain data, there
    are only 3 different values. I'd like to use a formula that will count the
    number of different values in column A, in this case the result is "3".

    Thanks,
    Paul



  2. #2
    Domenic
    Guest

    Re: Formula to count the number of different values in a range

    Try...

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

    OR

    =SUM(IF(A1:A15<>"",1/COUNTIF(A1:A15,A1:A15)))

    ....confirmed with CONTROL+SHIFT+ENTER.

    Hope this helps!

    In article <[email protected]>,
    "PCLIVE" <[email protected]> wrote:

    > I'm looking for a formula that will give me the number of different values
    > in a range.
    >
    > Example: Column A may have five cells that are "4", five cells that are
    > "7", five cells that are "9". Of the fifteen cells that contain data, there
    > are only 3 different values. I'd like to use a formula that will count the
    > number of different values in column A, in this case the result is "3".
    >
    > Thanks,
    > Paul


  3. #3
    PCLIVE
    Guest

    Re: Formula to count the number of different values in a range

    Wow.

    That's a more complicated formula that I expected. Nevertheless, it seems
    to work.

    Thanks for your help,
    Paul


    "Domenic" <[email protected]> wrote in message
    news:[email protected]...
    > Try...
    >
    > =SUMPRODUCT((A1:A15<>"")/COUNTIF(A1:A15,A1:A15&""))
    >
    > OR
    >
    > =SUM(IF(A1:A15<>"",1/COUNTIF(A1:A15,A1:A15)))
    >
    > ...confirmed with CONTROL+SHIFT+ENTER.
    >
    > Hope this helps!
    >
    > In article <[email protected]>,
    > "PCLIVE" <[email protected]> wrote:
    >
    >> I'm looking for a formula that will give me the number of different
    >> values
    >> in a range.
    >>
    >> Example: Column A may have five cells that are "4", five cells that are
    >> "7", five cells that are "9". Of the fifteen cells that contain data,
    >> there
    >> are only 3 different values. I'd like to use a formula that will count
    >> the
    >> number of different values in column A, in this case the result is "3".
    >>
    >> Thanks,
    >> Paul




+ 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