+ Reply to Thread
Results 1 to 6 of 6

Add new lines according to value in the spreadsheet

  1. #1
    Registered User
    Join Date
    02-21-2017
    Location
    Israel
    MS-Off Ver
    Office 365
    Posts
    5

    Unhappy Add new lines according to value in the spreadsheet

    Hi,

    I have a spread sheet with table (which for some reason I can't attach), but it has 4 columns - 2 descriptive (let's call those Sub Account and Sub Account 2) and a range (From, To) which contain values. I want in the cases where To>From to add a relevant number of new lines, until From=to. In the below example (table 1) I would like to create (table 2).

    Sub Account Sub Account 2 From To
    AD AD 15000520 15000523

    Sub Account Sub Account 2 From To
    AD AD 15000520 15000520
    AD AD 15000521 15000521
    AD AD 15000522 15000522
    AD AD 15000523 15000523

    HELPPPPPPPPPPPPPP

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,877

    Re: Add new lines according to value in the spreadsheet

    To attach a sample file--->

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-21-2017
    Location
    Israel
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Add new lines according to value in the spreadsheet

    Hi,

    I attached the file, can you help with the solution...?
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,553

    Re: Add new lines according to value in the spreadsheet

    This proposal employs four helper columns which may be moved and/or hidden for aesthetic purposes.
    The first helper column (E) is populated using: =D2-C2+1
    The first cell of the second helper column (F) is populated by the number one and the rest of the column is populated using: =SUM(F1,E2)
    The third and fourth helper columns (G:H) are populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The Sub Account and Sub Account 2 columns (J:K) for the new table are populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The From column (L) for the new table is populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    The To column (M) for the new table is populated using: =L2
    Note that I only filled the formulas down as far as row 620. Once you have enabled editing of the file you will need to pull the formulas in columns G:H and J:M down to row 1380 as indicated by the value in cell F618.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    02-21-2017
    Location
    Israel
    MS-Off Ver
    Office 365
    Posts
    5

    Re: Add new lines according to value in the spreadsheet

    Quote Originally Posted by jetemc View Post
    this proposal employs four helper columns which may be moved and/or hidden for aesthetic purposes.
    The first helper column (e) is populated using: =d2-c2+1
    the first cell of the second helper column (f) is populated by the number one and the rest of the column is populated using: =sum(f1,e2)
    the third and fourth helper columns (g:h) are populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    the sub account and sub account 2 columns (j:k) for the new table are populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    the from column (l) for the new table is populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    the to column (m) for the new table is populated using: =l2
    note that i only filled the formulas down as far as row 620. Once you have enabled editing of the file you will need to pull the formulas in columns g:h and j:m down to row 1380 as indicated by the value in cell f618.
    Let us know if you have any questions.
    amazing!!!! Thank you soooooooooo much!!!

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,553

    Re: Add new lines according to value in the spreadsheet

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools drop down in the ribbon above your first post. I hope that you have a blessed day.

+ 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. Removing lines from a spreadsheet
    By chloe88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2011, 09:08 AM
  2. [SOLVED] Remove lines from spreadsheet that have the value 0
    By ZorroZ in forum Excel General
    Replies: 2
    Last Post: 10-27-2009, 08:17 PM
  3. lines in a spreadsheet
    By akinard in forum Excel General
    Replies: 4
    Last Post: 06-28-2006, 11:00 AM
  4. [SOLVED] How do I reduce the number of lines in a spreadsheet?
    By Philamon in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 02-12-2006, 05:35 PM
  5. [SOLVED] I only want to print the horizontal lines in a spreadsheet
    By RANDY in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  6. I only want to print the horizontal lines in a spreadsheet
    By RANDY in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 07:05 AM
  7. I only want to print the horizontal lines in a spreadsheet
    By RANDY in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 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