+ Reply to Thread
Results 1 to 6 of 6

Inserting variable amount rows between rows

  1. #1
    Registered User
    Join Date
    06-22-2011
    Location
    ireland
    MS-Off Ver
    Excel 2003
    Posts
    6

    Inserting variable amount rows between rows

    I HAVE AN EXCEL SHEET WITH DATA PRESENTED AS BELOW


    Column A B C D E
    14/05/2006 16:00 2440 3160 2990 3890
    14/05/2006 19:00 2430 3210 3060 3890
    14/05/2006 20:00 2420 3220 3040 3940
    14/05/2006 22:00 2430 3200 2980 4090
    15/05/2006 01:00 2550 3160 2720 4080
    15/05/2006 04:00 2610 3230 2680 4130
    15/05/2006 06:00 2520 3230 2240 3680
    15/05/2006 12:00 2470 3260 3240 4470
    15/05/2006 16:00 2410 3210 3250 4310
    15/05/2006 19:00 2410 3220 3290 4500
    15/05/2006 20:00 2400 3230 3180 4520
    15/05/2006 22:00 2380 3150 3070 4570
    16/05/2006 01:00 2410 3250 3100 4565


    I WANT THE TIMES TO BE IN EVERY HOUR, IE: ADD IN ROWS BETWEEN EACH TIME, IE BETWEEN 16:00 AND 19:00 I WANT TO ADD IN 2 EXTRA ROWS WITH THE DATA FOR COLUMNS B,C,D ETC FOR THE 17:00 TO BE EQUAL TO THE 16:00 + 1/3 OF THE DIFFERENCE BETWEEN 16:00 AND 19:00, ETC THE WHOLE WAY DOWN,
    and the times changed to the theoretical new time



    THERE IS 18,000 ROWS WITH THE TIMES THE SAME FOR EACH BUT THE DATES CHANGING.

    THANKS VERY MUCH.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Inserting variable amount rows between rows

    This seems like a simple task, but I'm repeating a warning I've heard many times here on the forum. The task your describing is essentially "faking data" and:

    1) shouldn't be done
    2) shouldn't be necessary
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Inserting variable amount rows between rows

    Hi marko3

    I'd guess that JB's correct...he certainly has much more experience than I. However, I'm not going to ask "why"...you must have a reason. I'd prefer NOT to create your data so I will ask you to post a workbook that has your raw data in one worksheet and your desired output in another worksheet so I understand what you're looking for.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Inserting variable amount rows between rows

    Sorry Jas, the intended point (and I should've actually asked) was indeed "why"? Often when we look at the reason someone is attempting to create fake data, we can offer a better path to the intended FINAL result that wouldn't include fake data.

    I would guess some sort of chart or report that needs no gaps in it's current design.

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Inserting variable amount rows between rows

    @ JB

    No "Sorry" necessary. A simple demonstration of the OP's before and after will give us this
    we can offer a better path to the intended FINAL result that wouldn't include fake data.
    Appreciate your feedback.

  6. #6
    Registered User
    Join Date
    06-22-2011
    Location
    ireland
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Inserting variable amount rows between rows

    Hi everyone, thanks for the replies, the data is needed every hour, and i am using an interpolated values to get the estimate for the hours i dont have, it is necessary that i have data for each hour,




    date and time b c d e f
    14/05/2006 16:00 2440 3160 2990 3890 1540
    14/05/2006 17:00 2436.666667 3176.666667 3013.333333 3890 1523.333333
    14/05/2006 18:00 2433.333333 3193.333333 3036.666667 3890 1506.666667
    14/05/2006 19:00 2430 3210 3060 3890 1490
    14/05/2006 20:00 2420 3220 3040 3940 1490
    14/05/2006 21:00 2425 3210 3010 4015 1490
    14/05/2006 22:00 2430 3200 2980 4090 1490
    14/05/2006 23:00
    15/05/2006 00:00
    15/05/2006 01:00 2550 3160 2720 4080 1540
    15/05/2006 02:00
    15/05/2006 03:00
    15/05/2006 04:00 2610 3230 2680 4130 1560
    15/05/2006 05:00
    15/05/2006 06:00 2520 3230 2240 3680 1560
    15/05/2006 07:00
    15/05/2006 08:00
    15/05/2006 09:00
    15/05/2006 10:00
    15/05/2006 11:00
    15/05/2006 12:00 2470 3260 3240 4470 1340
    15/05/2006 13:00
    15/05/2006 14:00
    15/05/2006 15:00
    15/05/2006 16:00 2410 3210 3250 4310 1360
    15/05/2006 19:00 2410 3220 3290 4500 1310

    15/05/2006 22:00 2380 3150 3070 4570 1380
    16/05/2006 01:00 2410 3250 3100 4500 1480
    16/05/2006 04:00 2450 3080 3250 4040 1530
    16/05/2006 06:00 2470 3160 3190 4310 1630
    16/05/2006 12:00 2410 3210 3320 4470 1480
    16/05/2006 16:00 2370 3170 3130 4440 1360

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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