+ Reply to Thread
Results 1 to 7 of 7

COUNTIF:count the number of times

  1. #1
    swarfmaker
    Guest

    COUNTIF:count the number of times

    I am trying to use countif to count the number of times the value of cell I2
    occurs in column D but the following does not work.
    =COUNTIF(D6:D36,I2)
    This returns zero but I know that there are 2 occurances of the number in I2

    Any help appreciated.

    Iain



  2. #2
    Ron Rosenfeld
    Guest

    re: COUNTIF:count the number of times

    On Sun, 2 Oct 2005 12:04:11 +0100, "swarfmaker" <iain@swarfmaker.co.uk> wrote:

    >I am trying to use countif to count the number of times the value of cell I2
    >occurs in column D but the following does not work.
    >=COUNTIF(D6:D36,I2)
    >This returns zero but I know that there are 2 occurances of the number in I2
    >
    >Any help appreciated.
    >
    >Iain
    >


    You do not post examples of exactly what is in I2 and what is in column D.

    However, if the values appear identical, then most likely one is text and the
    other numeric. The "fix" would depend on which is which and how the values are
    generated.

    If you are looking for a value in I2 that may be a part of the value in column
    D, then your syntax is incorrect.


    --ron

  3. #3
    swarfmaker
    Guest

    re: COUNTIF:count the number of times


    "Ron Rosenfeld" <ronrosenfeld@nospam.org> wrote in message
    news:ufjvj11pij3h5jiohtq2oo5t9rkmkqv8on@4ax.com...
    > On Sun, 2 Oct 2005 12:04:11 +0100, "swarfmaker" <iain@swarfmaker.co.uk>
    > wrote:
    >
    >>I am trying to use countif to count the number of times the value of cell
    >>I2
    >>occurs in column D but the following does not work.
    >>=COUNTIF(D6:D36,I2)
    >>This returns zero but I know that there are 2 occurances of the number in
    >>I2
    >>
    >>Any help appreciated.
    >>
    >>Iain
    >>

    >
    > You do not post examples of exactly what is in I2 and what is in column D.
    >
    > However, if the values appear identical, then most likely one is text and
    > the
    > other numeric. The "fix" would depend on which is which and how the
    > values are
    > generated.
    >
    > If you are looking for a value in I2 that may be a part of the value in
    > column
    > D, then your syntax is incorrect.
    >
    >
    > --ron


    The values in column 2 are numeric (Blood Glucose values) in the range 2.5
    to 28
    The value in I2 is numeric, in this case 4 but can be changed by the user.
    I need to count all values in column D that are less than the value in I2.

    Iain



  4. #4
    Max
    Guest

    re: COUNTIF:count the number of times

    "swarfmaker" wrote:
    > .. I need to count all values in column D that are less than the value in

    I2.

    Instead of your earlier
    >>=COUNTIF(D6:D36,I2)


    Try: =COUNTIF(D6:D36,"<"&I2)
    --
    Rgds
    Max
    xl 97
    ---
    Singapore, GMT+8
    xdemechanik
    http://savefile.com/projects/236895
    --



  5. #5
    swarfmaker
    Guest

    re: COUNTIF:count the number of times

    "Max" <demechanik@yahoo.com> wrote in message
    news:%23rxMpj1xFHA.4032@TK2MSFTNGP15.phx.gbl...
    > "swarfmaker" wrote:
    >> .. I need to count all values in column D that are less than the value in

    > I2.
    >
    > Instead of your earlier
    >>>=COUNTIF(D6:D36,I2)

    >
    > Try: =COUNTIF(D6:D36,"<"&I2)
    > --
    > Rgds
    > Max
    > xl 97
    > ---
    > Singapore, GMT+8
    > xdemechanik
    > http://savefile.com/projects/236895
    > --
    >
    >

    Many thanks Max, that did the trick

    Iain



  6. #6
    Ron Rosenfeld
    Guest

    re: COUNTIF:count the number of times

    On Sun, 2 Oct 2005 14:02:09 +0100, "swarfmaker" <iain@swarfmaker.co.uk> wrote:

    >
    >"Ron Rosenfeld" <ronrosenfeld@nospam.org> wrote in message
    >news:ufjvj11pij3h5jiohtq2oo5t9rkmkqv8on@4ax.com...
    >> On Sun, 2 Oct 2005 12:04:11 +0100, "swarfmaker" <iain@swarfmaker.co.uk>
    >> wrote:
    >>
    >>>I am trying to use countif to count the number of times the value of cell
    >>>I2
    >>>occurs in column D but the following does not work.
    >>>=COUNTIF(D6:D36,I2)
    >>>This returns zero but I know that there are 2 occurances of the number in
    >>>I2
    >>>
    >>>Any help appreciated.
    >>>
    >>>Iain
    >>>

    >>
    >> You do not post examples of exactly what is in I2 and what is in column D.
    >>
    >> However, if the values appear identical, then most likely one is text and
    >> the
    >> other numeric. The "fix" would depend on which is which and how the
    >> values are
    >> generated.
    >>
    >> If you are looking for a value in I2 that may be a part of the value in
    >> column
    >> D, then your syntax is incorrect.
    >>
    >>
    >> --ron

    >
    >The values in column 2 are numeric (Blood Glucose values) in the range 2.5
    >to 28
    >The value in I2 is numeric, in this case 4 but can be changed by the user.
    >I need to count all values in column D that are less than the value in I2.
    >
    >Iain
    >


    Well, that's different than what you first posted.

    To count all the values in column D that are *LESS THAN* the value in I2, use:

    =COUNTIF(D:D,"<"&I2)

    or, if it is just part of Column D that you are counting:

    =COUNTIF(D6:D32,"<="&I2)


    --ron

  7. #7
    Max
    Guest

    re: COUNTIF:count the number of times

    You're welcome !
    --
    Rgds
    Max
    xl 97
    ---
    Singapore, GMT+8
    xdemechanik
    http://savefile.com/projects/236895
    --



+ 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