+ Reply to Thread
Results 1 to 7 of 7

Overlapping Dates per Name

Hybrid View

ENDO123 Overlapping Dates per Name 05-02-2013, 03:51 AM
WinteE Re: Overlapping Dates per Name 05-02-2013, 04:18 AM
ENDO123 Re: Overlapping Dates per Name 05-02-2013, 05:02 AM
WinteE Re: Overlapping Dates per Name 05-02-2013, 06:03 AM
ENDO123 Re: Overlapping Dates per Name 05-02-2013, 07:19 AM
WinteE Re: Overlapping Dates per Name 05-02-2013, 08:10 AM
ENDO123 Re: Overlapping Dates per Name 05-02-2013, 09:24 AM
  1. #1
    Registered User
    Join Date
    05-02-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    6

    Overlapping Dates per Name

    Hi There,

    Below I have a table start and end dates for specific employees.

    I have 43 days overlapping, but this does not take into account the the names, but rather the entire list. (Using this array formula {=SUM(IF(FREQUENCY(IF((MIN(Start)+COLUMN(OFFSET($B$1, , 0, , MAX(End)-MIN(Start)+1))-1<=End)+(MIN(Start)+COLUMN(OFFSET($B$1, , 0, , MAX(End)-MIN(Start)+1))-1>=Start)>1, MIN(Start)+COLUMN(OFFSET($B$1, , 0, , MAX(End)-MIN(Start)+1))-1, ""), MIN(Start)+COLUMN(OFFSET($B$1, , 0, , MAX(End)-MIN(Start)+1))-1)>1, 1, 0))}.

    (Note: the above formula has not been fully tested, but appears to work)

    "Start" and "End" dates have been defined as names.

    My first challenge is to use the formula above, but only sum the days that pertinent to the "Name", not the entire list

    "Overlaps with" - is the number of other transactions (row/line items) relating to the same employee that overlap. (2nd challenge)

    "First Overlap" - is the first line (duplicate name) (from top to bottom) that it overlaps with. (3rd Challenge). (I realize another column with transaction number would be required in this case)

    I would prefer to avoid VBA and use formulas. Any assitance would be greatly appreciated as I know this is quite a toughie:)


    Name Start End overlaps with by how many days First Overlap
    Liur, ANC_00005 2013/04/08 2013/04/18 43.00
    Bob, AB_00002 2013/04/19 2013/04/29 43.00
    Bob, AB_00002 2013/04/30 2013/05/10 43.00
    Beoln, ABD_00004 2013/05/11 2013/05/21 43.00
    Liur, ANC_00005 2013/04/08 2013/04/18 43.00
    Beoln, ABD_00004 2013/04/19 2013/04/29 43.00
    Beoln, ABD_00004 2013/04/30 2013/05/10 43.00
    Beoln, ABD_00004 2013/05/11 2013/05/21 43.00
    Beoln, ABD_00004 2013/05/22 2013/06/01 43.00
    Beoln, ABD_00004 2013/06/02 2013/06/12 43.00
    Beoln, ABD_00004 2013/06/13 2013/06/23 43.00
    Beoln, ABD_00004 2013/06/24 2013/07/04 43.00
    Beoln, ABD_00004 2013/07/05 2013/07/15 43.00
    Beoln, ABD_00004 2013/07/16 2013/07/26 43.00
    Beoln, ABD_00004 2013/07/27 2013/08/06 43.00

    Thanks,
    ENDO123

  2. #2
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544

    Re: Overlapping Dates per Name

    Use SUMPRODUCT() instead of SUM() and IF(). This gives you the opportunity to sum on multiple criteria.
    Just keep it simple !


    http://www.excelguide.eu
    In English as well as in Dutch

  3. #3
    Registered User
    Join Date
    05-02-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Overlapping Dates per Name

    Quote Originally Posted by WinteE View Post
    Use SUMPRODUCT() instead of SUM() and IF(). This gives you the opportunity to sum on multiple criteria.
    Thanks! I gave it a bash, with no luck though. Still finding my way around the sumproduct function.

    =SUMPRODUCT(FREQUENCY(IF((MIN(Start)+COLUMN(OFFSET($B$1,,0,,MAX(End)-MIN(Start)+1))-1<=End)+(MIN(Start)+COLUMN(OFFSET($B$1,,0,,MAX(End)-MIN(Start)+1))-1>=Start)>1,MIN(Start)+COLUMN(OFFSET($B$1,,0,,MAX(End)-MIN(Start)+1))-1,""),MIN(Start)+COLUMN(OFFSET($B$1,,0,,MAX(End)-MIN(Start)+1))-1)>1,1,0)*(Name=A8)

    This formula gave me a value error. I'm not sure I've gone about the SUMPRODUCT function above in the correct fashion. Could you perhaps point me in the right direction?

  4. #4
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544

    Re: Overlapping Dates per Name

    For example =SUMPRODUCT((A1:A100="Beoln")*(C1:C100>Start)*(D1:D100<End)) will give you the number of "Beoln" between startdate end enddate.

  5. #5
    Registered User
    Join Date
    05-02-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Overlapping Dates per Name

    Thanks! that sorts out the number of overlaps per name. I had to tweak the formula a little:
    =SUMPRODUCT((Start<=D8)*(End>=C8)*(Name=B8))-1

    would you be in a position to help me out with the others?

    Namely the first line item it overlaps with and the number of days it overlaps by;

    LineNumbeEmployee_Sys Start End Overlaps FirstOverlap NumberofDays
    _0001 Bobette, ABN_00003 2013/04/08 2013/04/18 1 _0002 43
    _0002 Bobette, ABN_00003 2013/04/17 2013/04/27 1 _0001 43
    _0003 Huir, A_00006 2013/04/28 2013/05/08 1 43
    _0004 Huir, A_00006 2013/05/09 2013/05/19 1 43
    _0005 Huir, A_00006 2013/04/04 2013/07/13 2 43

  6. #6
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544

    Re: Overlapping Dates per Name

    I guess something with INDEX and MATCH, but I don't know enough of these to solve this for you.

  7. #7
    Registered User
    Join Date
    05-02-2013
    Location
    Johannesburg, South Africa
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Overlapping Dates per Name

    Quote Originally Posted by WinteE View Post
    I guess something with INDEX and MATCH, but I don't know enough of these to solve this for you.
    No worries. Thanks anyway for the help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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