+ Reply to Thread
Results 1 to 4 of 4

Count number of dates between two date ranges, with two criteria

  1. #1
    Registered User
    Join Date
    07-04-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    49

    Count number of dates between two date ranges, with two criteria

    Hi
    I am trying to do a summary sheet on a workbook that counts the number of jobs running on each week (not just those that start during a particular week). I have tried using Countifs, and Sumproduct but cannot get this right so need some help please. Working on Excel 2007.

    Attachment is a sample workbook with the summary on Sheet 2 (Summary)- the numbers indicated in Yellow cells are those I want to see, but I need to put in a formula in each cell so it will be auto-populated by the data being entered into Sheet 1 (Data).
    The two criteria are the Project Name (Col A) and the Project Manager (Col B). I need to know how many projects each manager has running during each week.

    Pivot tables may be one way to do this but not really what I want to do with this.

    Thanks
    Steve
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,408

    Re: Count number of dates between two date ranges, with two criteria

    Put this in C5 of the Summary sheet:

    =COUNTIFS(Data!$A:$A,$A5,Data!$B:$B,$B5,Data!$C:$C,"<="&C$4,Data!$D:$D,">="&C$4+7)

    then copy across and down.

    Hope this helps.

    Pete

  3. #3
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Count number of dates between two date ranges, with two criteria

    In C5

    =SUMPRODUCT(--(Data!$A$2:$A$19=$A5),--(Data!$B$2:$B$19=$B5),--(Data!$C$2:$C$19<=C$4),--(Data!$D$2:$D$19>=C$4))

    Copy down and across
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Registered User
    Join Date
    07-04-2012
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    49

    Re: Count number of dates between two date ranges, with two criteria

    Thank you, perfect answer

+ 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