+ Reply to Thread
Results 1 to 21 of 21

A counting formula that won't count multiple instances of same val

  1. #1
    Dave Peterson
    Guest

    Re: A counting formula that won't count multiple instances of same val

    one way:

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

    (adjust the range to match, but don't use the whole column)

    Watercolor artist wrote:
    >
    > I need a formula that will count all the different instances of a value in a
    > column. For example, in the example below, the count would be 3 because, "1,"
    > though it occurs thrice, will only be counted once.
    >
    > Col A
    > 1
    > 1
    > 2
    > 3
    > 1
    >
    > Thanks in advance,
    > Howard


    --

    Dave Peterson

  2. #2
    RagDyer
    Guest

    Re: A counting formula that won't count multiple instances of same val

    Try this:

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

    This should work even though you might have blank cells in the range.
    --
    HTH,

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



    "Watercolor artist" <[email protected]> wrote in
    message news:[email protected]...
    > I need a formula that will count all the different instances of a value in

    a
    > column. For example, in the example below, the count would be 3 because,

    "1,"
    > though it occurs thrice, will only be counted once.
    >
    > Col A
    > 1
    > 1
    > 2
    > 3
    > 1
    >
    > Thanks in advance,
    > Howard



  3. #3
    BorisS
    Guest

    Re: A counting formula that won't count multiple instances of same

    can you quickly explain what this is doing? Just curious what the formula's
    logic is.
    --
    Boris


    "Dave Peterson" wrote:

    > one way:
    >
    > =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >
    > (adjust the range to match, but don't use the whole column)
    >
    > Watercolor artist wrote:
    > >
    > > I need a formula that will count all the different instances of a value in a
    > > column. For example, in the example below, the count would be 3 because, "1,"
    > > though it occurs thrice, will only be counted once.
    > >
    > > Col A
    > > 1
    > > 1
    > > 2
    > > 3
    > > 1
    > >
    > > Thanks in advance,
    > > Howard

    >
    > --
    >
    > Dave Peterson
    >


  4. #4
    Biff
    Guest

    Re: A counting formula that won't count multiple instances of same

    Hi!

    Try this quick and easy experiment....

    Enter these values and formulas in the designated cells:

    A1 = 20
    A2 = 20
    A3 = 1
    A4 = 2

    Enter this formula in B1 and copy down to B4:

    =(A1<>"")*1

    Enter this formula in C1 and copy down to C4:

    =COUNTIF(A$1:A$4,A1)

    Enter this formula in D1 and copy down to D4:

    =B1/C1

    And finally:

    =SUM(D1:D4)

    Notice the &"" in the Countif function:

    COUNTIF(A1:A4,A1:A4&"")

    What that does is during the calculation process it appends a null string to
    the array of values in A1:A4. If there was an empty cell in that range
    without the &"" the formula would return a division error. Try clearing one
    of the cells, A1:A4, and see what happens. So, if a cell is empty, the null
    string gets "placed" in that element of the array to prevent the error from
    occuring.

    Biff

    "BorisS" <[email protected]> wrote in message
    news:[email protected]...
    > can you quickly explain what this is doing? Just curious what the
    > formula's
    > logic is.
    > --
    > Boris
    >
    >
    > "Dave Peterson" wrote:
    >
    >> one way:
    >>
    >> =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >>
    >> (adjust the range to match, but don't use the whole column)
    >>
    >> Watercolor artist wrote:
    >> >
    >> > I need a formula that will count all the different instances of a value
    >> > in a
    >> > column. For example, in the example below, the count would be 3
    >> > because, "1,"
    >> > though it occurs thrice, will only be counted once.
    >> >
    >> > Col A
    >> > 1
    >> > 1
    >> > 2
    >> > 3
    >> > 1
    >> >
    >> > Thanks in advance,
    >> > Howard

    >>
    >> --
    >>
    >> Dave Peterson
    >>




  5. #5
    Watercolor artist
    Guest

    Re: A counting formula that won't count multiple instances of same

    Thanks Dave. It does exactly what I need.

    Howard

    "Dave Peterson" wrote:

    > one way:
    >
    > =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >
    > (adjust the range to match, but don't use the whole column)
    >
    > Watercolor artist wrote:
    > >
    > > I need a formula that will count all the different instances of a value in a
    > > column. For example, in the example below, the count would be 3 because, "1,"
    > > though it occurs thrice, will only be counted once.
    > >
    > > Col A
    > > 1
    > > 1
    > > 2
    > > 3
    > > 1
    > >
    > > Thanks in advance,
    > > Howard

    >
    > --
    >
    > Dave Peterson
    >


  6. #6
    Watercolor artist
    Guest

    Re: A counting formula that won't count multiple instances of same

    Thanks Dave. It does exactly what I need.

    Howard

    "Dave Peterson" wrote:

    > one way:
    >
    > =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >
    > (adjust the range to match, but don't use the whole column)
    >
    > Watercolor artist wrote:
    > >
    > > I need a formula that will count all the different instances of a value in a
    > > column. For example, in the example below, the count would be 3 because, "1,"
    > > though it occurs thrice, will only be counted once.
    > >
    > > Col A
    > > 1
    > > 1
    > > 2
    > > 3
    > > 1
    > >
    > > Thanks in advance,
    > > Howard

    >
    > --
    >
    > Dave Peterson
    >


  7. #7
    Dave Peterson
    Guest

    Re: A counting formula that won't count multiple instances of same val

    one way:

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

    (adjust the range to match, but don't use the whole column)

    Watercolor artist wrote:
    >
    > I need a formula that will count all the different instances of a value in a
    > column. For example, in the example below, the count would be 3 because, "1,"
    > though it occurs thrice, will only be counted once.
    >
    > Col A
    > 1
    > 1
    > 2
    > 3
    > 1
    >
    > Thanks in advance,
    > Howard


    --

    Dave Peterson

  8. #8
    RagDyer
    Guest

    Re: A counting formula that won't count multiple instances of same val

    Try this:

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

    This should work even though you might have blank cells in the range.
    --
    HTH,

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



    "Watercolor artist" <[email protected]> wrote in
    message news:[email protected]...
    > I need a formula that will count all the different instances of a value in

    a
    > column. For example, in the example below, the count would be 3 because,

    "1,"
    > though it occurs thrice, will only be counted once.
    >
    > Col A
    > 1
    > 1
    > 2
    > 3
    > 1
    >
    > Thanks in advance,
    > Howard



  9. #9
    BorisS
    Guest

    Re: A counting formula that won't count multiple instances of same

    can you quickly explain what this is doing? Just curious what the formula's
    logic is.
    --
    Boris


    "Dave Peterson" wrote:

    > one way:
    >
    > =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >
    > (adjust the range to match, but don't use the whole column)
    >
    > Watercolor artist wrote:
    > >
    > > I need a formula that will count all the different instances of a value in a
    > > column. For example, in the example below, the count would be 3 because, "1,"
    > > though it occurs thrice, will only be counted once.
    > >
    > > Col A
    > > 1
    > > 1
    > > 2
    > > 3
    > > 1
    > >
    > > Thanks in advance,
    > > Howard

    >
    > --
    >
    > Dave Peterson
    >


  10. #10
    Biff
    Guest

    Re: A counting formula that won't count multiple instances of same

    Hi!

    Try this quick and easy experiment....

    Enter these values and formulas in the designated cells:

    A1 = 20
    A2 = 20
    A3 = 1
    A4 = 2

    Enter this formula in B1 and copy down to B4:

    =(A1<>"")*1

    Enter this formula in C1 and copy down to C4:

    =COUNTIF(A$1:A$4,A1)

    Enter this formula in D1 and copy down to D4:

    =B1/C1

    And finally:

    =SUM(D1:D4)

    Notice the &"" in the Countif function:

    COUNTIF(A1:A4,A1:A4&"")

    What that does is during the calculation process it appends a null string to
    the array of values in A1:A4. If there was an empty cell in that range
    without the &"" the formula would return a division error. Try clearing one
    of the cells, A1:A4, and see what happens. So, if a cell is empty, the null
    string gets "placed" in that element of the array to prevent the error from
    occuring.

    Biff

    "BorisS" <[email protected]> wrote in message
    news:[email protected]...
    > can you quickly explain what this is doing? Just curious what the
    > formula's
    > logic is.
    > --
    > Boris
    >
    >
    > "Dave Peterson" wrote:
    >
    >> one way:
    >>
    >> =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >>
    >> (adjust the range to match, but don't use the whole column)
    >>
    >> Watercolor artist wrote:
    >> >
    >> > I need a formula that will count all the different instances of a value
    >> > in a
    >> > column. For example, in the example below, the count would be 3
    >> > because, "1,"
    >> > though it occurs thrice, will only be counted once.
    >> >
    >> > Col A
    >> > 1
    >> > 1
    >> > 2
    >> > 3
    >> > 1
    >> >
    >> > Thanks in advance,
    >> > Howard

    >>
    >> --
    >>
    >> Dave Peterson
    >>




  11. #11
    Watercolor artist
    Guest

    Re: A counting formula that won't count multiple instances of same

    Thanks Dave. It does exactly what I need.

    Howard

    "Dave Peterson" wrote:

    > one way:
    >
    > =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >
    > (adjust the range to match, but don't use the whole column)
    >
    > Watercolor artist wrote:
    > >
    > > I need a formula that will count all the different instances of a value in a
    > > column. For example, in the example below, the count would be 3 because, "1,"
    > > though it occurs thrice, will only be counted once.
    > >
    > > Col A
    > > 1
    > > 1
    > > 2
    > > 3
    > > 1
    > >
    > > Thanks in advance,
    > > Howard

    >
    > --
    >
    > Dave Peterson
    >


  12. #12
    Biff
    Guest

    Re: A counting formula that won't count multiple instances of same

    Hi!

    Try this quick and easy experiment....

    Enter these values and formulas in the designated cells:

    A1 = 20
    A2 = 20
    A3 = 1
    A4 = 2

    Enter this formula in B1 and copy down to B4:

    =(A1<>"")*1

    Enter this formula in C1 and copy down to C4:

    =COUNTIF(A$1:A$4,A1)

    Enter this formula in D1 and copy down to D4:

    =B1/C1

    And finally:

    =SUM(D1:D4)

    Notice the &"" in the Countif function:

    COUNTIF(A1:A4,A1:A4&"")

    What that does is during the calculation process it appends a null string to
    the array of values in A1:A4. If there was an empty cell in that range
    without the &"" the formula would return a division error. Try clearing one
    of the cells, A1:A4, and see what happens. So, if a cell is empty, the null
    string gets "placed" in that element of the array to prevent the error from
    occuring.

    Biff

    "BorisS" <[email protected]> wrote in message
    news:[email protected]...
    > can you quickly explain what this is doing? Just curious what the
    > formula's
    > logic is.
    > --
    > Boris
    >
    >
    > "Dave Peterson" wrote:
    >
    >> one way:
    >>
    >> =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >>
    >> (adjust the range to match, but don't use the whole column)
    >>
    >> Watercolor artist wrote:
    >> >
    >> > I need a formula that will count all the different instances of a value
    >> > in a
    >> > column. For example, in the example below, the count would be 3
    >> > because, "1,"
    >> > though it occurs thrice, will only be counted once.
    >> >
    >> > Col A
    >> > 1
    >> > 1
    >> > 2
    >> > 3
    >> > 1
    >> >
    >> > Thanks in advance,
    >> > Howard

    >>
    >> --
    >>
    >> Dave Peterson
    >>




  13. #13
    BorisS
    Guest

    Re: A counting formula that won't count multiple instances of same

    can you quickly explain what this is doing? Just curious what the formula's
    logic is.
    --
    Boris


    "Dave Peterson" wrote:

    > one way:
    >
    > =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >
    > (adjust the range to match, but don't use the whole column)
    >
    > Watercolor artist wrote:
    > >
    > > I need a formula that will count all the different instances of a value in a
    > > column. For example, in the example below, the count would be 3 because, "1,"
    > > though it occurs thrice, will only be counted once.
    > >
    > > Col A
    > > 1
    > > 1
    > > 2
    > > 3
    > > 1
    > >
    > > Thanks in advance,
    > > Howard

    >
    > --
    >
    > Dave Peterson
    >


  14. #14
    RagDyer
    Guest

    Re: A counting formula that won't count multiple instances of same val

    Try this:

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

    This should work even though you might have blank cells in the range.
    --
    HTH,

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



    "Watercolor artist" <[email protected]> wrote in
    message news:[email protected]...
    > I need a formula that will count all the different instances of a value in

    a
    > column. For example, in the example below, the count would be 3 because,

    "1,"
    > though it occurs thrice, will only be counted once.
    >
    > Col A
    > 1
    > 1
    > 2
    > 3
    > 1
    >
    > Thanks in advance,
    > Howard



  15. #15
    Dave Peterson
    Guest

    Re: A counting formula that won't count multiple instances of same val

    one way:

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

    (adjust the range to match, but don't use the whole column)

    Watercolor artist wrote:
    >
    > I need a formula that will count all the different instances of a value in a
    > column. For example, in the example below, the count would be 3 because, "1,"
    > though it occurs thrice, will only be counted once.
    >
    > Col A
    > 1
    > 1
    > 2
    > 3
    > 1
    >
    > Thanks in advance,
    > Howard


    --

    Dave Peterson

  16. #16
    Watercolor artist
    Guest

    Re: A counting formula that won't count multiple instances of same

    Thanks Dave. It does exactly what I need.

    Howard

    "Dave Peterson" wrote:

    > one way:
    >
    > =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >
    > (adjust the range to match, but don't use the whole column)
    >
    > Watercolor artist wrote:
    > >
    > > I need a formula that will count all the different instances of a value in a
    > > column. For example, in the example below, the count would be 3 because, "1,"
    > > though it occurs thrice, will only be counted once.
    > >
    > > Col A
    > > 1
    > > 1
    > > 2
    > > 3
    > > 1
    > >
    > > Thanks in advance,
    > > Howard

    >
    > --
    >
    > Dave Peterson
    >


  17. #17
    Biff
    Guest

    Re: A counting formula that won't count multiple instances of same

    Hi!

    Try this quick and easy experiment....

    Enter these values and formulas in the designated cells:

    A1 = 20
    A2 = 20
    A3 = 1
    A4 = 2

    Enter this formula in B1 and copy down to B4:

    =(A1<>"")*1

    Enter this formula in C1 and copy down to C4:

    =COUNTIF(A$1:A$4,A1)

    Enter this formula in D1 and copy down to D4:

    =B1/C1

    And finally:

    =SUM(D1:D4)

    Notice the &"" in the Countif function:

    COUNTIF(A1:A4,A1:A4&"")

    What that does is during the calculation process it appends a null string to
    the array of values in A1:A4. If there was an empty cell in that range
    without the &"" the formula would return a division error. Try clearing one
    of the cells, A1:A4, and see what happens. So, if a cell is empty, the null
    string gets "placed" in that element of the array to prevent the error from
    occuring.

    Biff

    "BorisS" <[email protected]> wrote in message
    news:[email protected]...
    > can you quickly explain what this is doing? Just curious what the
    > formula's
    > logic is.
    > --
    > Boris
    >
    >
    > "Dave Peterson" wrote:
    >
    >> one way:
    >>
    >> =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >>
    >> (adjust the range to match, but don't use the whole column)
    >>
    >> Watercolor artist wrote:
    >> >
    >> > I need a formula that will count all the different instances of a value
    >> > in a
    >> > column. For example, in the example below, the count would be 3
    >> > because, "1,"
    >> > though it occurs thrice, will only be counted once.
    >> >
    >> > Col A
    >> > 1
    >> > 1
    >> > 2
    >> > 3
    >> > 1
    >> >
    >> > Thanks in advance,
    >> > Howard

    >>
    >> --
    >>
    >> Dave Peterson
    >>




  18. #18
    BorisS
    Guest

    Re: A counting formula that won't count multiple instances of same

    can you quickly explain what this is doing? Just curious what the formula's
    logic is.
    --
    Boris


    "Dave Peterson" wrote:

    > one way:
    >
    > =SUMPRODUCT((A1:A99<>"")/COUNTIF(A1:A99,A1:A99&""))
    >
    > (adjust the range to match, but don't use the whole column)
    >
    > Watercolor artist wrote:
    > >
    > > I need a formula that will count all the different instances of a value in a
    > > column. For example, in the example below, the count would be 3 because, "1,"
    > > though it occurs thrice, will only be counted once.
    > >
    > > Col A
    > > 1
    > > 1
    > > 2
    > > 3
    > > 1
    > >
    > > Thanks in advance,
    > > Howard

    >
    > --
    >
    > Dave Peterson
    >


  19. #19
    RagDyer
    Guest

    Re: A counting formula that won't count multiple instances of same val

    Try this:

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

    This should work even though you might have blank cells in the range.
    --
    HTH,

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



    "Watercolor artist" <[email protected]> wrote in
    message news:[email protected]...
    > I need a formula that will count all the different instances of a value in

    a
    > column. For example, in the example below, the count would be 3 because,

    "1,"
    > though it occurs thrice, will only be counted once.
    >
    > Col A
    > 1
    > 1
    > 2
    > 3
    > 1
    >
    > Thanks in advance,
    > Howard



  20. #20
    Dave Peterson
    Guest

    Re: A counting formula that won't count multiple instances of same val

    one way:

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

    (adjust the range to match, but don't use the whole column)

    Watercolor artist wrote:
    >
    > I need a formula that will count all the different instances of a value in a
    > column. For example, in the example below, the count would be 3 because, "1,"
    > though it occurs thrice, will only be counted once.
    >
    > Col A
    > 1
    > 1
    > 2
    > 3
    > 1
    >
    > Thanks in advance,
    > Howard


    --

    Dave Peterson

  21. #21
    Watercolor artist
    Guest

    A counting formula that won't count multiple instances of same val

    I need a formula that will count all the different instances of a value in a
    column. For example, in the example below, the count would be 3 because, "1,"
    though it occurs thrice, will only be counted once.

    Col A
    1
    1
    2
    3
    1

    Thanks in advance,
    Howard

+ 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