+ Reply to Thread
Results 1 to 8 of 8

Split Table into individual lines

  1. #1
    Registered User
    Join Date
    02-28-2019
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    94

    Split Table into individual lines

    Hi,

    I have a table which shows annual leave for employees. each line is for an event, so there are 3 columns for the event, start date and end date and duration. what I would like to do is get that split out so there is a line entry for each day booked.

    For example. if and annual leave event was for 3 days, 01/05/2022-03/05/2022, in my current table it shows that in 1 line with the duration column reading 3.Plus all the other info such as names etc.
    what I would like is for there to be 3 lines showing this event. Line 1 would read 01/05/2022, duration 1, plus all the other info such as names etc. Line 2 would read 02/05/2022, duration 1, plus all the other info such as names etc. Line 3 would read 03/05/2022, duration 1, plus all the other info such as names etc.

    and so on.

    I hope that makes sense and i have attach a data file sample to support anyone who may be able to help me here.

    Many thanks in advance.
    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,213

    Re: Split Table into individual lines

    Please try at

    A12:Axx
    =IF(ROWS(A$11:A11)>SUM(ROUNDUP(Table2[DurationDays],)),"",LOOKUP(ROWS(A$11:A11)-1,MMULT(--(ROW(Table2)>TRANSPOSE(ROW(Table2))),ROUNDUP(Table2[DurationDays],)),Table2[Id]))

    B12:Mxx
    =IF($A12="","",VLOOKUP($A12,Table2,MATCH(B$11,Table2[#Headers],),))

    G12:Gxx
    =IF($A12="","",WORKDAY(VLOOKUP($A12,Table2,7,),COUNTIF(A$11:$A11,A12)))
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-28-2019
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    94

    Re: Split Table into individual lines

    Hi Bo_Ry,

    Thank you for your reply. What you have suggested does work in formula version, however I must apologies as I missed a couple of key details .

    The table at the top of the page, the one I want to transpose is actually in a power Query connection and not on a worksheet.

    Do you know what the code equivalent is to create the transposed table in Power Query?

    Many thanks and apologies for missing that part out,

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

    Re: Split Table into individual lines

    Try

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-28-2019
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    94

    Re: Split Table into individual lines

    Hi,

    I have modified my attached file that has those tables as connection files. I don't think I gave enough of an explanation at the beginning of this thread.

    In my live file my data is a PowerQuery table connection and nota table in the workbook like in this file. Obviously I cannot send the file with the external links because it would not load for you. I have only added the tables in this sample file to allow me to turn it into a PowerQuery connection as you can see. It is that table connection that I require to “transposed" but directly in PowerQuery.
    I do not want the output table in the workbook tab, just as a Table connection in PowerQuery.

    I hope that makes sense, it felt hard to explain. I have attach the new data file sample to support,

    Many thanks in advance.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    02-28-2019
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    94

    Re: Split Table into individual lines

    HI,

    Could someone advise if this is posted to the wrong forum. I still require support if anyone is able to help,

    Thank you

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,448

    Re: Split Table into individual lines

    It's OK where it is and you have now bumped it, so let's wait and see.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  8. #8
    Registered User
    Join Date
    02-28-2019
    Location
    Peterborough
    MS-Off Ver
    2013
    Posts
    94

    Re: Split Table into individual lines

    Bumping this as I still need help

+ 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] split data horizontal for each customer into table individual
    By MKLAQ in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-10-2021, 07:51 AM
  2. Split application Data to individual lines
    By mlopez60120 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2016, 12:08 AM
  3. Copy individual lines from cell with broken lines by char(10)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-12-2015, 05:40 AM
  4. Split in to Individual Files
    By FallingDown in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2013, 08:18 AM
  5. [SOLVED] grid lines for individual cells
    By ffffloyd in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-25-2012, 06:17 AM
  6. Replies: 1
    Last Post: 11-20-2005, 07:50 PM
  7. Replies: 3
    Last Post: 03-16-2005, 12:06 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