+ Reply to Thread
Results 1 to 4 of 4

How do I insert cells so the each data sub-set has 3 rows only

  1. #1
    Forum Contributor
    Join Date
    11-22-2020
    Location
    Sydney Australia
    MS-Off Ver
    365
    Posts
    202

    How do I insert cells so the each data sub-set has 3 rows only

    Hi All,

    I thought it would be simple, but apparently not. In the attached sheet, I have a column of data where some data sets have 3 rows, some have 2 rows and some have 1 row.

    It is important that all data sets have 3 rows. How do I go about automatically inserting rows, so that each data set has 3 rows and they must be grouped together?

    This is important because:
    1. The imported data comes in a single column and can have varying grouped data lengths of 1, 2 or 3 rows per set as in the spreadsheet.
    2. These data sets form the X values in a linear regression
    3. Unless there is a way to run a linear regression with a "dynamic" number of X values, it is much simpler and faster to make sure that there are 3 X values every time, even if some of them are set to a zero value.

    The total number of rows in the imported data will vary.

    I suspect this will require a VBA routine.

    Just had another thought.
    Is there a way to determine length of the data sets and transpose from a single column into an array?
    I note that there are some solutions that do this as long as as all data sub-sets have the same number of entries in the column.

    Any guidance is very graciously accepted.

    Jeff.
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,303

    Re: How do I insert cells so the each data sub-set has 3 rows only

    looking at your sample, do you really mean "must have three rows" or should it be "must have three columns". ?

  3. #3
    Forum Contributor
    Join Date
    11-22-2020
    Location
    Sydney Australia
    MS-Off Ver
    365
    Posts
    202

    Re: How do I insert cells so the each data sub-set has 3 rows only

    Hi Torachan.....

    I need to end up with 3 columns for the linear regression. Each row is for a different linear regression.

    But the data comes is as one single column. As I have shown in the spreadsheet, the imported data can have 3 x A, 2 x B, 1 x C etc as shown in Column A. So I need to add the extra 1 x B and 2 x C etc in Column A, the single column so that I get 3 x everything that can be transposed into columns E,F & G.

    The transposed data is for 1 linear regression per line, using 3 x A in one LR and 3 x B in the next LR and 3 x C in the next and so on.

    Does that make a bit more sense ?

  4. #4
    Forum Contributor
    Join Date
    11-22-2020
    Location
    Sydney Australia
    MS-Off Ver
    365
    Posts
    202

    Re: How do I insert cells so the each data sub-set has 3 rows only

    Update...

    I managed to find a solution at:

    https://www.extendoffice.com/documen...to-column.html

    This works perfectly and can be adapted to be used on my LR's.

    Thanks for your 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. Replies: 5
    Last Post: 03-17-2021, 08:15 PM
  2. Insert blank rows when data changes and calculate how many rows to insert
    By Smartmart in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-23-2020, 01:04 PM
  3. [SOLVED] Insert Xnumber (X=A1) of rows between data in a table& copy data from a range to new cells
    By blue_clouds_mountain in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-09-2019, 12:47 PM
  4. Copy cells with data - paste (insert rows) to next sheet.
    By BPSJACK in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2016, 01:28 PM
  5. [SOLVED] Insert number of rows with data to new sheets based on values in cells
    By keithtran12 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-28-2013, 11:57 AM
  6. Insert rows and enter data in blank cells.
    By jscalem in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-22-2013, 06:47 AM
  7. Copy paste data, insert rows, insert data and change . to -
    By xWiZardx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2010, 01:44 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