+ Reply to Thread
Results 1 to 2 of 2

Counting between 2 dates

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Counting between 2 dates

    Hi,

    I am trying to count the number of observations between two dates, named as start_date and end_date. The values to count are in column B in a range named fund_returns and the associated dates are in a range in column A named dates.

    The start_date is 31/10/2007 and the end_date is 31/10/2010 so there should be 36 monthly observations counted by my formula between those dates:

    {=COUNT(IF(dates>start_date,dates<=end_date,fund_returns))}

    However, this formula counts only 24 items. Can someone please suggest what I’m doing wrong.

    Thanks!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Counting between 2 dates

    If you are using 2007:

    =SUMIFS(fund_returns,dates,">"&start_date,dates,"<="&end_date)

    or in all versions:

    =SUMIF(dates,">"&start_date,fund_returns)-SUMIF(dates,">"&end_date,fund_returns)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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