+ Reply to Thread
Results 1 to 4 of 4

Countif between dates help

  1. #1
    Forum Contributor
    Join Date
    12-05-2006
    Location
    London
    MS-Off Ver
    Excel 365 (Version 2008) [work] & 365 [home]
    Posts
    189

    Countif between dates help

    Hi all,

    I am hoping someone can help me with a formula that will populate a report.

    We have 4 week reporting blocks.

    The dates are held in the named ranges:
    wk1Start, wk1End, wk2Start, wk2End.


    I need to do a formula that works thus:

    If a row is between wk1Start and wk1End countif(Column E on sheet called Current Period matches the Report sheet cell B2),"")

    I have added a sample if this makes it clearer.

    Thank in advance
    Attached Files Attached Files
    Last edited by Lensmeister; 11-11-2011 at 06:11 AM. Reason: Added a sample workbook
    A mad football researcher and Statistician - ok just mad really !

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,313

    Re: Countif between dates help

    If using Excel 2003:

    Cell D7: =SUMPRODUCT(--(CurrentPeriod!$B$1:$B$31=Report!$C7),--(CurrentPeriod!$A$1:$A$31>=INDIRECT(LEFT(D$6,3)&"Start")),--(CurrentPeriod!$A$1:$A$31<INDIRECT(LEFT(D$6,3)&"End")))

    Drg down and across.

    If using Excel 2007, use COUNTIFS


    Regards
    Last edited by TMS; 11-11-2011 at 06:58 AM.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    12-05-2006
    Location
    London
    MS-Off Ver
    Excel 365 (Version 2008) [work] & 365 [home]
    Posts
    189

    Re: Countif between dates help

    Thanks for this.

    I have tried it and it worked in the testip file I uploaded. But when I adapted it for my own sheet it didn't work

    I have reattached it to see why it never worked.

    Thanks again.
    Attached Files Attached Files
    Last edited by Lensmeister; 11-11-2011 at 08:13 AM. Reason: Can't spell !

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,313

    Re: Countif between dates help

    OK, I've reworked the formula to reflect the restructured workbook. See attached.

    For future reference, you will help yourself, and others, if you apply the formula to the original test workbook and restructure the test workbook to match the production workbook. In that way, you are more likely to be able to copy the formulae from the test environment to the production environment.

    You'll save yourself and everyone involved time and effort.

    Regards, TMS
    Attached Files Attached Files

+ 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