+ Reply to Thread
Results 1 to 6 of 6

Count ids within a timescale - duplicate ids with multiple visit dates

  1. #1
    Registered User
    Join Date
    01-12-2021
    Location
    Yorkshire, UK
    MS-Off Ver
    2013
    Posts
    3

    Question Count ids within a timescale - duplicate ids with multiple visit dates

    Hello, I wonder if anyone can help with a problem please, this is my first post.

    I have a list of ids, and a list of visit dates, many of them are the same id but they have multiple visit dates.
    I need a formula to count the number of ids that have had visits within a 2 week period of their previous visit for each week. I only need to count the id once even if they have had multiple visits before the week-ending date.
    I've already calculated the number of days since the previous visit and calculated to show those with a visit less than 2 weeks apart but I am struggling to bring it all together, I have a feeling it's a combination of MAX and IF formulas but would very much appreciate any help!

    I hope this makes sense, let me know if you have any questions.

    Many thanks
    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,116

    Re: Count ids within a timescale - duplicate ids with multiple visit dates

    In L2, copied down:

    =SUM(INDEX(($D$2:$D$38>=K2)*($D$2:$D$38<=K2+14)/COUNTIFS($D$2:$D$38,$D$2:$D$38&"",$A$2:$A$38,$A$2:$A$38&""),0))

    In your expected results, you said the answer at L2 should have been 2. Why?
    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

  3. #3
    Registered User
    Join Date
    01-12-2021
    Location
    Yorkshire, UK
    MS-Off Ver
    2013
    Posts
    3

    Re: Count ids within a timescale - duplicate ids with multiple visit dates

    Quote Originally Posted by Glenn Kennedy View Post
    In L2, copied down:

    =SUM(INDEX(($D$2:$D$38>=K2)*($D$2:$D$38<=K2+14)/COUNTIFS($D$2:$D$38,$D$2:$D$38&"",$A$2:$A$38,$A$2:$A$38&""),0))

    In your expected results, you said the answer at L2 should have been 2. Why?

    Thank you,
    So I wanted to count only those where, in the visit closest to the report date (Column K) there had been a maximum of 2 weeks between this visit and the previous visit date. I had got 2 because i filtered on the column D (visit dates) to only show visits before 05/04/2020 and then summed Col G (col g indicates a 1 if the visit was within 2 weeks of the previous visit) for the 2 id's most recent visit dates on the 30/03/2020 and the 03/04/2020.

  4. #4
    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,116

    Re: Count ids within a timescale - duplicate ids with multiple visit dates

    OK. Try it now.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-12-2021
    Location
    Yorkshire, UK
    MS-Off Ver
    2013
    Posts
    3

    Re: Count ids within a timescale - duplicate ids with multiple visit dates

    Perfect! Thank you so much for your help

  6. #6
    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,116

    Re: Count ids within a timescale - duplicate ids with multiple visit dates

    You're welcome & thanks for the rep.

+ 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. Matching Dates with visit #'s
    By barrenaj in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-04-2020, 01:04 AM
  2. [SOLVED] count the no. of visit
    By amarjeet.it in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 04-24-2019, 09:30 AM
  3. [SOLVED] Predicted Timescale vs Actual Timescale
    By SPalmerUK in forum Excel General
    Replies: 7
    Last Post: 10-19-2017, 08:39 AM
  4. Pivot table counts visits by month when one visit has multiple lines
    By BrookieOU in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-22-2016, 03:52 PM
  5. [SOLVED] Count the number of visits by visit types.
    By Marvin85 in forum Excel General
    Replies: 8
    Last Post: 10-02-2014, 05:19 PM
  6. [SOLVED] count strings based on dates if find duplicate consider it one
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-10-2012, 01:06 AM
  7. Replies: 2
    Last Post: 02-23-2006, 07:46 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