+ Reply to Thread
Results 1 to 5 of 5

Calculate Overlapping Leave for different categories

  1. #1
    Registered User
    Join Date
    04-07-2020
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    45

    Red face Calculate Overlapping Leave for different categories

    Hi,

    Could you please help me with a formula.

    I need to calculate overlapping leave on each day for particular categories.

    I have attached sample data.

    For eg; In sample data, there are 2 teachers on leave on 1 July, so I need to get 2 under 1 July in the sheet.

    Thanks.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-18-2014
    Location
    Singapore
    MS-Off Ver
    Excel 2016 / 2019
    Posts
    251

    Re: Calculate Overlapping Leave for different categories

    Hi, attached solution using Power Query, Since you are using Excel 2016, just bring in your table to Power Query Editor, sort ascending Start date
    End Date, create a custom column to find out the dates in between each category Start and end date
    Group it, aggregate then pivot it, this is the first query same as your sheet1

    then aggregate (Sum) by category in 2nd query to obtain the second summary table that you want


    Please go to Power Query editor to reference my solution

    Rgds
    Attached Files Attached Files
    Christopher Yap

  3. #3
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Calculate Overlapping Leave for different categories

    Hi,
    In I2 and across you can use the below ARRAY formula:
    =COUNT(IF(($G2=$E$11:$E$15)*($C$11:$C$15 <=I$1)*($D$11:$D$15 >=I$1),ROW($B$11:$B$15)))

    *array formulas are confirmed with CTRL+SHIFT+ENTER
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Calculate Overlapping Leave for different categories

    You can also use the countifs function, but for some reason I wasn't able to get this work....

    =COUNTIFS($E$11:$E$16,$G2,$C$11:$C$16,"<=I$1",$D$11:$D$16,"=>I$1")

  5. #5
    Registered User
    Join Date
    04-07-2020
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    45

    Re: Calculate Overlapping Leave for different categories

    Thanks Belinda, appreciate that.

+ 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] Calculate overlapping date range & amount of fte
    By RW001 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 06-11-2020, 08:54 AM
  2. Formula that filters 2 categories then calculate?
    By nutstae in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-09-2018, 08:27 PM
  3. Calculate Payroll by categories
    By yrndtn in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-01-2018, 02:12 AM
  4. Replies: 8
    Last Post: 02-27-2018, 05:02 AM
  5. Calculate Non-Overlapping Hours
    By garciapliz in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-08-2013, 04:43 PM
  6. How to calculate overlapping times of multiple ranges
    By bgrablin in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-12-2013, 12:22 PM
  7. Replies: 1
    Last Post: 05-18-2011, 10: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