+ Reply to Thread
Results 1 to 3 of 3

Inserting rows based on durations in columns and updating dates accordingly into new rows.

  1. #1
    Registered User
    Join Date
    05-21-2023
    Location
    Alberta, Canada
    MS-Off Ver
    Microsoft 365
    Posts
    2

    Question Inserting rows based on durations in columns and updating dates accordingly into new rows.

    I'll start with saying i've spent 6+ hours trying to get OpenAI to give me a working solution but was unsuccessful.

    I have data in excel between columns A to AD. Column K is a start date (includes time), and Column L is an end date (includes time). Columns M, N and O are durations. Consider it to be duration1, duration2, and duration3. The order here is important. The rest of the data is descriptive and not pertinent to the issue.

    Ask: If data is 'clean' the difference between the end date and start date equals the sum of any values in columns M, N and O.
    In order as I check to see if any of rows M, N or O are populated, when I notice M populated, i first have to update the end date (Column K cell value + duration in column M cell value). Then since column N is also populated. I need to insert a new row, where the start date for this new row will be the previous rows end date. Same thing since column O has data, then i'll insert another row and the previous rows end date will be the new start date, and the 2nd inserted rows end date will be that new start date + the duration in column O.

    I've attached an example that likely explains this better. The green table below is my target result.VBARequest.xlsm

    When looking at the durations, if lets say N doesn't have data, but M and O have data, then i'd only need a total of two rows (one existing row where the end date is updated, and one inserted row) where i update the start and end dates accordingly. For all inserted rows I need to ensure I copy along all the rest of the columns data between column A to J, and P to AD.

    If data exists in only one column (either of M, N or O) then no new rows need to be added since the difference in start and end date would already equal the duration available. Further if in the inserted rows the durations not being used can be blanked out this would allow for every row to only have one duration in any of columns M, N or O which would equal the difference between end and start dates for that row.

    Any direction / assistance or guidance as to whether this is possible aside from a series of manual copies and pastes - would be appreciated!

    Thanks!!

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Inserting rows based on durations in columns and updating dates accordingly into new r

    Please Login or Register  to view this content.
    "Sheet1" is input, "Sheet2" is output
    Attached Files Attached Files
    Last edited by JohnTopley; 05-21-2023 at 10:47 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    05-21-2023
    Location
    Alberta, Canada
    MS-Off Ver
    Microsoft 365
    Posts
    2

    Re: Inserting rows based on durations in columns and updating dates accordingly into new r

    Thanks so much for this! it helps exactly as I wished it would!

+ 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] Inserting Multiple rows and updating formula on next tab
    By kriminaal in forum Excel General
    Replies: 3
    Last Post: 01-24-2017, 08:18 AM
  2. Replies: 1
    Last Post: 05-30-2015, 03:12 PM
  3. Inserting rows and columns based on the given value
    By nynamyna in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-18-2011, 05:59 PM
  4. [SOLVED] Inserting rows, updating linked worksheet
    By Patti in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-20-2006, 05:30 PM
  5. [SOLVED] Updating, Deleting and inserting rows over two Excel Sheets
    By Dilip Mistry in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 AM
  6. [SOLVED] Updating, Deleting and inserting rows over two Excel Sheets
    By Dilip Mistry in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 AM
  7. [SOLVED] Updating, Deleting and inserting rows over two Excel Sheets
    By Dilip Mistry in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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