+ Reply to Thread
Results 1 to 8 of 8

Surveillance data- finding counts of 2 or more cases in past 14 days

  1. #1
    Registered User
    Join Date
    06-06-2022
    Location
    Chicago, Illinois
    MS-Off Ver
    MS Excel 2019
    Posts
    3

    Surveillance data- finding counts of 2 or more cases in past 14 days

    I am working with school health data (ie: new cases of people infected with a virus) and I have the data stored in line lists that generally have the following columns:

    Name Student or Staff Grade/Classroom Home City Date of onset


    What I'm trying to do is figure out the formula or commands that will allow me to count how many classrooms have had ≥ 2 positive cases in the past 14 days (rolling). I have very limited excel experience so apologies in advance if this is a simple fix. Also, if this is not enough information or confusing, please let me know. Thanks!
    Attached Files Attached Files
    Last edited by clari14; 06-06-2022 at 05:07 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Surveillance data- finding counts of 2 or more cases in past 14 days

    Hi Clari and welcome to the forum,

    In Excel Pivot tables there is a way to do a "Difference of Previous" that may work for your problem. If you create a Pivot with your data and show the values as a difference from the previous and then pick those out that are 2 or less you might have your needed answer. See the attached where I've done this with your example data.
    Same Class Previous 2 days Pivot.xlsx
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Surveillance data- finding counts of 2 or more cases in past 14 days

    See if this formula entered in F2 and copied down works. Without meaningful data (rolling) though I am not sure if this does what you want.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Right now they all return FALSE as none of your data qualify.
    Dave

  4. #4
    Registered User
    Join Date
    06-06-2022
    Location
    Chicago, Illinois
    MS-Off Ver
    MS Excel 2019
    Posts
    3

    Re: Surveillance data- finding counts of 2 or more cases in past 14 days

    Thanks, Dave. My question for you is what does that formula mean? I guess I'm trying to understand why they all return FALSE? What is wrong with my data that creates this FALSE result? Thanks in advance!

  5. #5
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Surveillance data- finding counts of 2 or more cases in past 14 days

    I guess the best way to start for me is can you tell us what results you expect to see given the workbook you posted? As it is there are no instances with 2 or more cases in a 14 day period. Hence the all FALSE results.

    From there perhaps someone can back engineer sufficient understanding to create a formula. As it is I have more than one interpretation of your request in mind. None of them can make sense (to me) given the upload and what you request in post #1.
    Last edited by FlameRetired; 06-07-2022 at 10:49 PM.

  6. #6
    Registered User
    Join Date
    06-06-2022
    Location
    Chicago, Illinois
    MS-Off Ver
    MS Excel 2019
    Posts
    3

    Re: Surveillance data- finding counts of 2 or more cases in past 14 days

    Ok, so each row is an observation and all of the observations on this list are on this list because they have tested positive for a virus. The result I expect is for excel to count how many classrooms have had 2 or more positive cases within a 14 day period. For example, I attached an updated workbook and just by looking at it, I can see that John and Bob are in the same classroom and have dates of onset (positive case) within 14 days. I just want to be able to make a calculation for that because the actual dataset I am using is much bigger.
    Attached Files Attached Files

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Surveillance data- finding counts of 2 or more cases in past 14 days

    Let's see if I've interpreted correctly this time.

    I had to create a copy of the original data and sort it on the date ascending.

    In column G this formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    03-29-2013
    Location
    lakewood, usa
    MS-Off Ver
    exce2013
    Posts
    112

    Re: Surveillance data- finding counts of 2 or more cases in past 14 days

    This is brute force
    ColH and I are the dates +14 and -14 establish a range.
    The formula in ColG is a count of classrm and dates that meet the criteria.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The formula in ColL lists the Class with the number of occurances.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Sum count with entries >1.
    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)

Similar Threads

  1. COUNTIFS formula that counts cells that have values within the past week
    By calathea in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-21-2020, 08:57 AM
  2. How to identify data that exists in past 30 days
    By Sid_2987 in forum Excel General
    Replies: 13
    Last Post: 08-29-2019, 05:27 AM
  3. Replies: 10
    Last Post: 02-19-2019, 03:28 AM
  4. Need help finding averages using past data only
    By SL4CKER in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-28-2015, 07:03 PM
  5. Finding highest value over the past 365 days
    By moneyball123 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-10-2014, 09:26 PM
  6. [SOLVED] Loop Counts Past # of Rows....WHY?
    By Gard5096 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-17-2012, 02:51 PM
  7. Sum of past 30 days of data
    By drummerdickens in forum Excel General
    Replies: 7
    Last Post: 09-22-2011, 05:48 AM

Tags for this Thread

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