+ Reply to Thread
Results 1 to 9 of 9

CountIF Between 2 Dates

  1. #1
    Registered User
    Join Date
    12-15-2003
    Location
    UK
    Posts
    52

    CountIF Between 2 Dates

    Hi All

    I need a formula that will count the number of dates within a column that are between 2 cells both with a date in each?

    Many Thanks

    Chris

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try Sumproduct

    http://www.xldynamic.com/source/xld.SUMPRODUCT.html

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    12-15-2003
    Location
    UK
    Posts
    52

    Formula

    I have read all through the link u gave, som,e real useful data on there, but it doesent actually state how to use the sum product formula to check a list of data for dates between 2 specific dates in cell references, it has hjow to check each specified data entered but would be a huge formula and would need changing every day, not ideal.

    Any More Ideas

    Chris

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

    =Sumproduct(--(date_range>=Date1),--(date_range<=Date2),--(data_range=criteria))

    where date_range is range containing dates to search between Date1 & Date2
    data_range is range containing data to search criteria
    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.

  5. #5
    Registered User
    Join Date
    12-15-2003
    Location
    UK
    Posts
    52
    That looks Good, Just what im looking for, although i have entered the following formula:

    =SUMPRODUCT(--(date_range>=B174),--(date_range<=B175),--(datarange=D:10:D149)

    Gettin #NAME come up, Cells B174 and B175 have the 2 dates in

    Any Ideas?

    Chris

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You have to replace date_range and data_range with actual ranges containing the data , eg. A10:A149, unless you named your ranges?

    Also, the last argument in your formula references a range incorrectly

    --(datarange=D:10:D149) should be perhaps --(datarange=D10:D149)

  7. #7
    Registered User
    Join Date
    12-15-2003
    Location
    UK
    Posts
    52
    ok, Have changed formula to the below but still get #NAME

    =SUMPRODUCT(--(D10:D149>=B174),--(D10:D149<=B175),--(Datarange=D10:D149))

    Any more ideas, or am i just missin soemthing?

    Chris

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    What's the last part supposed to check for?

    What's datarange?

  9. #9
    Registered User
    Join Date
    12-15-2003
    Location
    UK
    Posts
    52
    Ah Yes, forgot about that, well thanks its all workin now i removed the end part.

    Cheers

    Chris

+ 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