+ Reply to Thread
Results 1 to 5 of 5

Count number of overlapping days in multiple date ranges

  1. #1
    Registered User
    Join Date
    04-22-2015
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    2

    Count number of overlapping days in multiple date ranges

    Hi all,

    I would like to calculate the number of overlapping days in multiple date ranges. This is a set of pharmacy data for which I want to know how many days a patient has supply of all his medications. Attached is a sample data, and I would like to know how many days the patient has all 3 of his medications.

    Appreciate your help on this!

    Sample data.xlsx

  2. #2
    Registered User
    Join Date
    04-22-2015
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    17

    Re: Count number of overlapping days in multiple date ranges

    There might be an easier way to do this, but here is what I came up with: Sample data.xlsx

    I don't know if there is a way to count the number of days between two dates and then assign them a particular identifier - if there is, then there will be an easier way to do it.

  3. #3
    Registered User
    Join Date
    04-22-2015
    Location
    Singapore
    MS-Off Ver
    2010
    Posts
    2

    Re: Count number of overlapping days in multiple date ranges

    Thanks bluelillies for your help! Seems like some form of manual work is required. The full dataset that I have has close to 200 patients and spans over 4 years. Hopefully there will be an easier way to do this!

  4. #4
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: Count number of overlapping days in multiple date ranges

    This is a cross post at

    http://www.mrexcel.com/forum/excel-q...te-ranges.html
    and is against the form rules.

    Thanks
    Mark the thread as solved if you are satisfied with the answer.


    In your first post under the thread tools.

    Mahju

  5. #5
    Forum Contributor
    Join Date
    05-06-2015
    Location
    Sri Lanka
    MS-Off Ver
    2016, 2007
    Posts
    135

    Re: Count number of overlapping days in multiple date ranges

    This is what I have done.
    • I made your dates to numbers (home tab -> number group -> number)
    • I made your data a table (home tab -> format as table)
    • pivot the data
    • in rows -> ID
    • Columns - > Values
    • in Values - > Min of Supply Start
    • in Values - > Max of Supply Ends

    Converted to dates, can take the difference
    please let me know if anything needs to clarify
    Capture.JPG
    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. [SOLVED] Calculating # of Overlapping days with several date ranges and conditions
    By ZafferAhmed in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-30-2021, 05:44 AM
  2. Calculating # of Overlapping days with several date ranges.
    By CarlSVM in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-06-2014, 07:09 AM
  3. Summing # of overlapping days with lots of date ranges
    By tvnsf in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-08-2013, 01:48 PM
  4. how to count # rows having overlapping date ranges
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-13-2011, 01:54 PM
  5. Counting Continuous Days within overlapping Date Ranges
    By mgaworecki in forum Excel General
    Replies: 3
    Last Post: 09-07-2011, 08:33 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