+ Reply to Thread
Results 1 to 4 of 4

Count dates for previous month

  1. #1

    Count dates for previous month

    Hoping someone can help, I'm about to lose my mind. I've tried every
    combination of sum, if, countif, sumproduct, you name it and I can't
    figure it out.

    I've got a column of dates. What I want to do is count the number of
    dates that occurred last month, taking into consideration that a year
    change could be between the current month and last month.

    This was my latest attempt, but again it didn't work:

    =SUM(IF(MONTH(C2:C8)=MONTH(TODAY()-DAY(TODAY())),1,0))

    If you can save what's left of my sanity, please help.

    Cheers,

    Scrib


  2. #2
    Domenic
    Guest

    Re: Count dates for previous month

    Try...

    =SUMPRODUCT(--(C2:C8-DAY(C2:C8)+1=DATE(YEAR(TODAY()),MONTH(TODAY())-1,1))
    )

    Hope this helps!

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

    > Hoping someone can help, I'm about to lose my mind. I've tried every
    > combination of sum, if, countif, sumproduct, you name it and I can't
    > figure it out.
    >
    > I've got a column of dates. What I want to do is count the number of
    > dates that occurred last month, taking into consideration that a year
    > change could be between the current month and last month.
    >
    > This was my latest attempt, but again it didn't work:
    >
    > =SUM(IF(MONTH(C2:C8)=MONTH(TODAY()-DAY(TODAY())),1,0))
    >
    > If you can save what's left of my sanity, please help.
    >
    > Cheers,
    >
    > Scrib


  3. #3

    Re: Count dates for previous month

    Thank you very much, Domenic! That did the trick.


  4. #4
    Ron Rosenfeld
    Guest

    Re: Count dates for previous month

    On 27 Apr 2006 17:44:11 -0700, [email protected] wrote:

    >Hoping someone can help, I'm about to lose my mind. I've tried every
    >combination of sum, if, countif, sumproduct, you name it and I can't
    >figure it out.
    >
    >I've got a column of dates. What I want to do is count the number of
    >dates that occurred last month, taking into consideration that a year
    >change could be between the current month and last month.
    >
    >This was my latest attempt, but again it didn't work:
    >
    >=SUM(IF(MONTH(C2:C8)=MONTH(TODAY()-DAY(TODAY())),1,0))
    >
    >If you can save what's left of my sanity, please help.
    >
    >Cheers,
    >
    >Scrib


    You can use COUNTIF.

    =COUNTIF(C2:C8,">"&DATE(YEAR(TODAY()),MONTH(TODAY())-1,0))-
    COUNTIF(C2:C8,">"&TODAY()-DAY(TODAY()))
    --ron

+ 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