+ Reply to Thread
Results 1 to 5 of 5

count date ranges

Hybrid View

  1. #1
    murtaza
    Guest

    count date ranges

    hi there,

    i've column with date date
    25/06/2005
    26/06/2005
    05/07/2005

    i just want the total counts for the months for egs. june = 2 and july =1 in
    this case

    regards
    murtaza

  2. #2
    Max
    Guest

    Re: count date ranges

    One play ..

    Assume the col of dates is in Sheet1, A1:A100

    In Sheet2, put

    In A1: =ROWS($A$1:A1)

    In B1:
    =SUMPRODUCT((Sheet1!$A$1:$A$100<>"")*(MONTH(Sheet1!$A$1:$A$100)=A1))

    Select A1:B1, fill down to B12

    Col A simply returns the month number (Jan=1, Feb=2, etc)
    while col B returns the desired counts for the months

    Adapt the ranges to suit ..

    For a cleaner look in Sheet2, we could switch off extraneous zeros display
    in the sheet via clicking:
    Tools > Options > View tab > Uncheck "Zero values" > OK
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----
    "murtaza" <murtaza74@lycos.com> wrote in message
    news:CD0D1AAA-F5B9-4BAE-ACDD-8EF4E6CF8FE0@microsoft.com...
    > hi there,
    >
    > i've column with date date
    > 25/06/2005
    > 26/06/2005
    > 05/07/2005
    >
    > i just want the total counts for the months for egs. june = 2 and july =1

    in
    > this case
    >
    > regards
    > murtaza




  3. #3
    Ragdyer
    Guest

    Re: count date ranges

    With dates in A1 to A25,
    Enter "Jan" (no quotes) in B1, and copy down to get the 12 months listed in
    the 3 character format.
    Enter this formula in C1, and copy down to C12:

    =SUMPRODUCT(--(TEXT(A1:A25,"mmm")=B1))
    --
    HTH,

    RD

    ---------------------------------------------------------------------------
    Please keep all correspondence within the NewsGroup, so all may benefit !
    ---------------------------------------------------------------------------

    "murtaza" <murtaza74@lycos.com> wrote in message
    news:CD0D1AAA-F5B9-4BAE-ACDD-8EF4E6CF8FE0@microsoft.com...
    > hi there,
    >
    > i've column with date date
    > 25/06/2005
    > 26/06/2005
    > 05/07/2005
    >
    > i just want the total counts for the months for egs. june = 2 and july =1

    in
    > this case
    >
    > regards
    > murtaza



  4. #4
    Max
    Guest

    Re: count date ranges

    > =SUMPRODUCT(--(TEXT(A1:A25,"mmm")=B1))

    Neater !

    ... but think the range A1:A25 needs to be fixed: $A$1:$A$25
    before copying down from C1 <g>
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----



  5. #5
    RagDyeR
    Guest

    Re: count date ranges

    You're right Max.<g>

    BUT, I also forget, as you *didn't*, to include the possibility that the
    entire referenced range might not be completely populated, and therefore
    return an incorrect answer.

    =SUMPRODUCT((TEXT($A$1:$A$25,"mmm")=B1)*($A$1:$A$25<>""))
    --

    Regards,

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



    "Max" <demechanik@yahoo.com> wrote in message
    news:OSczirziFHA.3256@TK2MSFTNGP12.phx.gbl...
    > =SUMPRODUCT(--(TEXT(A1:A25,"mmm")=B1))


    Neater !

    ... but think the range A1:A25 needs to be fixed: $A$1:$A$25
    before copying down from C1 <g>
    --
    Rgds
    Max
    xl 97
    ---
    GMT+8, 1° 22' N 103° 45' E
    xdemechanik <at>yahoo<dot>com
    ----




+ 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