+ Reply to Thread
Results 1 to 13 of 13

How to split values into new rows.

  1. #1
    Registered User
    Join Date
    12-14-2019
    Location
    Cannock, United Kingdom
    MS-Off Ver
    Office 365
    Posts
    10

    How to split values into new rows.

    I have a list of SKUs and a list of year models that the part fits. How can I get each SKU to put just one year model in each row while keeping the same SKU?
    Attached Files Attached Files

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: How to split values into new rows.

    I don't understand what this means
    How can I get each SKU to put just one year model in each row while keeping the same SKU?
    you have two distinct SKUs and three models for one and two for the other and a bunch of years in columns C through G.
    since it is a small sample, a results tab with hand entered results would be very helpful.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    12-14-2019
    Location
    Cannock, United Kingdom
    MS-Off Ver
    Office 365
    Posts
    10

    Re: How to split values into new rows.

    It's quite hard to explain what I am trying to do. As you have advised I have added a result tab in book 2 to show what I am trying to achieve.
    Attached Files Attached Files

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How to split values into new rows.

    Please find a helper column in Sheet1 column G2. The formula does a cumulative count of years in each row.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Then in columns F:H of 'Results' filled down until you get blanks

    F2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    G2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    H2
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Dave

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466
    Here's my thought
    Attached Files Attached Files
    Last edited by davesexcel; 03-04-2020 at 07:58 AM.
    Quang PT

  6. #6
    Registered User
    Join Date
    12-14-2019
    Location
    Cannock, United Kingdom
    MS-Off Ver
    Office 365
    Posts
    10

    Re: How to split values into new rows.

    Nice. And it's easy to change to account for more columns. Thanks a lot.

  7. #7
    Registered User
    Join Date
    12-14-2019
    Location
    Cannock, United Kingdom
    MS-Off Ver
    Office 365
    Posts
    10

    Re: How to split values into new rows.

    Hmm. Having a slight issue with this. I have added more data and copied down the formulas but the results I am getting are trunkated. Please see example.
    Attached Files Attached Files

  8. #8
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How to split values into new rows.

    bebo01999 is not online at the moment.

    Try changing the range references in his formula to match your new data. The last row is now 25 instead of 6.

  9. #9
    Registered User
    Join Date
    12-14-2019
    Location
    Cannock, United Kingdom
    MS-Off Ver
    Office 365
    Posts
    10

    Re: How to split values into new rows.

    Cool thanks. as you can probably tell, I have only a basic understanding of Excel.

  10. #10
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How to split values into new rows.

    You're welcome.

  11. #11
    Registered User
    Join Date
    12-14-2019
    Location
    Cannock, United Kingdom
    MS-Off Ver
    Office 365
    Posts
    10

    Re: How to split values into new rows.

    Thanks for all the help so far. Let's change it up a bit. What if instead of a list of years it was "from - to" instead but to get the same result?
    Attached Files Attached Files

  12. #12
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: How to split values into new rows.

    So try again:
    A2:
    Please Login or Register  to view this content.
    B2:
    Please Login or Register  to view this content.
    Both ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    C2:
    Please Login or Register  to view this content.
    Attached Files Attached Files

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How to split values into new rows.

    Another way. Does not require Ctrl + Shift + Enter.

    Change the years ranges in 'Sheet1' C2:D6 any way you like. I used what you last posted including the blank cell D4.

    In cell D1 a named helper cell that saves having to recalculate Total number of years in each cell. It's named TotalYears. I borrowed heavily from forum member BMV for this formula. In cell A2 filled down and across column B until you get blanks.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In C2 filled down until you get blanks will return the years.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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] Edit vba to split values over 10 columns and required rows
    By JNEWMAN in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2019, 11:16 AM
  2. VBA: Split cell values into multiple rows and keep other data
    By kishansingh027 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-30-2018, 09:04 PM
  3. [SOLVED] VBA Split Cell Contents to New Rows & Copy Cells containing single values to the new rows
    By jaimelwilson in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-14-2017, 05:30 PM
  4. [SOLVED] Copy rows and populate with split cell values
    By Niclal in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 02-07-2014, 04:06 PM
  5. Split Rows For Unique Values In A Column To Different Workbooks
    By ashishmac in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-22-2013, 02:45 PM
  6. Split cell data into multiple new rows and copy other column values
    By jooga in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-01-2010, 02:30 AM
  7. VB to split and repeat rows based on cell values
    By rgjohnson in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2010, 06:57 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