+ Reply to Thread
Results 1 to 3 of 3

First & last date in range

  1. #1
    Registered User
    Join Date
    03-12-2012
    Location
    London
    MS-Off Ver
    Office 365 ProPlus 64 bit
    Posts
    35

    First & last date in range

    I have a list of data attached which shows a sample of days taken sick by employees.

    On some rows, the dates shows that the sickness lasted for 1 day only, but in some the sickness lasts for multiple days contigously. I need to generate a summary sheet that lists 1 row per employee per sickness bout, with a start date, end date & the number of hours taken off during that time. See example on summary tab which I've manually created based on a few rows from the orig data.

    I started by using networkdays to highlight where the rows were that are an example of contigious sick days, but didn't get much further.

    It doesn't have to be done through a formula, if it's a couple of manual steps/a pivot table etc. happy to do that instead. I just have about 100,000 rows of original data which I need to summarise in this way so looking for some help as to where to start.. Any ideas please?


    Many thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: First & last date in range

    Please try at sheet Summary,
    A2:B2
    =INDEX('Orig Data'!A:A,$E2)
    C2
    =INDEX('Orig Data'!B:B,MAX(E2,E3-1))
    D2
    =SUMIFS('Orig Data'!C:C,'Orig Data'!A:A,A2,'Orig Data'!B:B,">="&B2,'Orig Data'!B:B,"<="&C2)
    E2 (helper)
    =AGGREGATE(15,6,ROW('Orig Data'!$A$2:$A$1325)/'Orig Data'!$E$2:$E$1325,ROWS(E$2:E2))
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-12-2012
    Location
    London
    MS-Off Ver
    Office 365 ProPlus 64 bit
    Posts
    35

    SOLVED: Re: First & last date in range

    Amazing!! I've got absolutely no idea how that formula works but it seems to do the job perfectly. Thank you very much.

+ 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. Replies: 4
    Last Post: 03-21-2018, 09:25 AM
  2. Highlight a date range if today's date falls within that range
    By sdarnell in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-01-2014, 10:03 AM
  3. VBA to enter date range based on date range in above cell
    By Pierce Quality in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-19-2013, 08:45 AM
  4. Search date range +/- 7 days and return date that falls within range
    By tlafferty in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-13-2013, 03:26 PM
  5. Replies: 9
    Last Post: 06-21-2012, 03:46 PM
  6. [SOLVED] Calculate how many days in one date range fall into a second date range
    By globalpontoon in forum Excel General
    Replies: 2
    Last Post: 05-08-2012, 03:02 PM
  7. Replies: 4
    Last Post: 03-18-2011, 07:02 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