+ Reply to Thread
Results 1 to 2 of 2

number of days with measurements in each 7 day period

  1. #1
    Registered User
    Join Date
    02-20-2018
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    42

    number of days with measurements in each 7 day period

    Hello, I have a column with the subject number and a column with the dates. I'm trying to find the number of dates within each 7 day period that have at least one occurance, starting from the first date listed for each subject. There is also a condition column where I only want the dates to be counted if there is at least one occurance with condition X. Each subject has a maximum of close to 12 weeks of measurements so if its possible I'd like to average the number dates in the first week for all subjects and average the values for the second week and so on. I've added a speadsheet with a sample of the data where I've manually put values in for the each 7 day period for each subject and the averages. I don not need a formula for the date range column I only added that for reference. If there's any further clarification needed let me know. Thanks for your time.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: number of days with measurements in each 7 day period

    There are 3 formulae in the sheet. Different shading = different formula. The one that does the heavy lifting is this:

    =IFERROR(1/(1/SUM(IF(FREQUENCY(IF(($A$2:$A$700=F$2)*($C$2:$C$700="x")*($B$2:$B$700<>"")*($B$2:$B$700>=F$3+7*(ROWS(F$4:F4)-1))*($B$2:$B$700<F$3+7+7*(ROWS(F$4:F4)-1)),$B$2:$B$700),$B$2:$B$700),1))),"")


    See sheet.

    IMPORTANT>>>>
    You seem to be using an older version of Excel than me. So, please refer to the attached file. If the formulae are enclosed within a pair of { }, these are array formulae.

    These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. After that, the array can be dragged down as normal, to cover the desired range.

    You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

+ 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. Count Number of Days, In a rolling 12 month period
    By ExcelNewbie1977 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-19-2016, 03:29 AM
  2. Replies: 0
    Last Post: 06-11-2015, 03:12 AM
  3. Count number of days between a period
    By amurray2307 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2013, 05:40 AM
  4. [SOLVED] Number of days within a period
    By nicholas.jacka in forum Excel General
    Replies: 1
    Last Post: 10-25-2012, 06:17 AM
  5. Determining number of specific days in period
    By MJohnston in forum Excel General
    Replies: 3
    Last Post: 06-25-2009, 01:57 PM
  6. Calculating number of days in each month during a given period.
    By josnah in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-28-2007, 02:52 AM
  7. Calculating interest on number of days in the period
    By Ron in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-17-2005, 09:06 PM

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