+ Reply to Thread
Results 1 to 8 of 8

Count If Between Certain Dates and Activities

  1. #1
    Registered User
    Join Date
    06-24-2014
    Location
    South Wales
    MS-Off Ver
    2010
    Posts
    27

    Count If Between Certain Dates and Activities

    I have attached my spread sheet for you. What I need to do is count the amount of people who have been on support (per a week) in a 4 weekly period, but only if they have a status of placed or drop-in. The formula I have in there at the moment was taken from an earlier version of the spread sheet, where there was no status, just hours received. The info goes into Row 66 and onwards, titled for "Supporting People Use Only". So, if they have the status of placed or drop-in, and the start date is in week two, I would need it to count that, but obviously not in week 1; the same goes for if they have an end date; if they received service in week 1 and 2, but had an end date in week 2, I would only want them counted for these two weeks. I'm hoping this makes sense, but if not please ask me questions!

  2. #2
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Count If Between Certain Dates and Activities

    Hi mrsdeapsleap- Paste this ARRAY FORMULA in D2 and copy across:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This formula calculates checkdates directly, bypassing your look-up on sheet 2. I'll post a workbook with a better approach in a few minutes.

    *You must press CTRL+SHIFT+ENTER to confirm entry of an ARRAY FORMULA in the Formula Bar.
    When copying the formula to other cells, make sure the copied cell is not part of the Paste Area.


    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Last edited by leelnich; 06-15-2017 at 04:42 PM.

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Count If Between Certain Dates and Activities

    In the attached workbook, I re-arranged the period dates on Sheet2 from column to row. This simplifies look-up in ALL your weekly formulae.
    I used this ARRAY FORMULA in D68 (and copy across):
    =SUMPRODUCT(($B$15:$B$49={"placed","drop-in"})*($H$15:$H$49<=(Sheet2!A$18+6))*(IF($I$15:$I$49,--($I$15:$I$49>=Sheet2!A$18),1)))

    I also adjusted the formulae in rows 70-71 to use the new look-up.

    *You must press CTRL+SHIFT+ENTER to confirm entry of an ARRAY FORMULA in the Formula Bar.
    When copying the formula to other cells, make sure the copied cell is not part of the Paste Area.


    Please click the Add Reputation star below any helpful posts, and if you have your answer, mark your thread as SOLVED (Thread Tools up top). Thanks!-Lee
    Attached Files Attached Files
    Last edited by leelnich; 06-15-2017 at 05:20 PM.

  4. #4
    Registered User
    Join Date
    06-24-2014
    Location
    South Wales
    MS-Off Ver
    2010
    Posts
    27

    Re: Count If Between Certain Dates and Activities

    Many thanks for your help; this worked perfectly! And thanks for re-arranging my period dates.

    Arrays and VBA are two things I really need to look into, as not had much need to use them so far, but now I have more knowledge of Excel, think I am ready to take that step!

    Thanks again,
    Emma.

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Count If Between Certain Dates and Activities

    You're quite welcome, glad I could be of service! Thank you for the rep. -Lee

  6. #6
    Registered User
    Join Date
    06-24-2014
    Location
    South Wales
    MS-Off Ver
    2010
    Posts
    27

    Re: Count If Between Certain Dates and Activities

    Hi again,

    I thought your formula had worked, but on closer inspection, it seems to be slightly out I have since added a count of people on support (i.e. not necessarily having received hours of support during the week, but no end date, so still current), and this has shown up the issue. I have attached the amended spread sheet for you, so you can see what I mean. Range C86:G86 shows the amount of people who have received support in that week, but the range above (C86:G86) is using your formula, and is saying the number of people still current, but not necessarily receiving support is one less than those on support, which can't be right; in fact in week 4 there is a difference of 4!.

    Any ideas? This is driving me mad!!!!!!!!!!!!!!

    Thanks, Emma.
    Attached Files Attached Files

  7. #7
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Count If Between Certain Dates and Activities

    Hi Emma- Sorry, I'm pretty busy, but I'll TRY to look it over this evening. -Lee

  8. #8
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Count If Between Certain Dates and Activities

    Ok, the test for {"placed","drop-in"} wasn't working correctly. Paste this ARRAY FORMULA in D85 and copy across:

    =SUMPRODUCT((($B$15:$B$66="placed")+($B$15:$B$66="drop-in"))*($H$15:$H$66<=(Sheet2!A$18+6))*(IF($I$15:$I$66,--($I$15:$I$66>=Sheet2!A$18),1)))

    My apologies, I'm sure that was frustrating. I hope this solves your problem. -Lee

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Activities completed by date - having to manually update dates from another worksheet
    By Gian_C in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-20-2015, 10:27 PM
  2. Create List of Early Dates from Multiple Identifiers and Activities
    By bbarry404 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-28-2013, 08:11 AM
  3. Countif to Count Activities in a time interval on a Specific Date
    By rajxkumar in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 12-28-2011, 03:55 PM
  4. Replies: 1
    Last Post: 09-22-2010, 01:57 AM
  5. Mapping Dates to activities onto a calender on another sheet
    By Arnoldleg in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 09-21-2009, 12:57 PM
  6. Replies: 1
    Last Post: 10-10-2005, 06:05 PM
  7. Replies: 1
    Last Post: 10-10-2005, 08:30 AM

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