+ Reply to Thread
Results 1 to 4 of 4

creating a table with variable numbers of rows

  1. #1
    Registered User
    Join Date
    12-17-2020
    Location
    Maryland
    MS-Off Ver
    Excel for Mac v16.42
    Posts
    6

    creating a table with variable numbers of rows

    That may not be a properly descriptive title to this request.

    What I need to do is to check against a summary table and fill in rows between the ones in the summary. The value in each row of the summary table needs to be used when we get to that in the new table. The attached sample file shows it.
    Column B highlighted in yellow is what I want to stretch out. Column C contains the values that I will be working with.
    So between 1 (value 95) and 2.5 (value 103) there is a difference of 9 (103-95). Therefore there need to be 9 rows that get filled in with (2.5-1)/9+previous row put in col F. This makes every row the same distance apart.

    But when I get to the difference between 5 (value 109) and 2.5 (value 103) the difference is now 6 (109-103). So now there need to be 6 rows that get filled in with (5-2.5)/6+previous row.

    So what I need is some type of if statement that can check when the number of rows needed is complete so that it can move down a row and pull the values for F and G directly from the summary table before starting to calculate the in between values for the extra rows.

    I'm not so worried about adding rows on the fly. I can copy it down so that it is longer than needed and chop off the end. I just need the if formulas to dynamically change as it pulls from the table because ultimately I want to apply this to different tables which will have different values in col D.

    thanks for any help
    Maureen
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,911

    Re: creating a table with variable numbers of rows

    This proposal employs a helper column (E) which may be moved and/or hidden for aesthetic purposes.
    The helper column is populated using: =SUM(E3,D4)
    The three output columns are set up in J:L so that you can compare the results of the formulas to the original as there are some differences:
    The * column: =INDEX(D$4:D$13,AGGREGATE(15,6,(ROW(D$4:D$13)-ROW(D$3))/(ROWS(A$1:A1)<=E$4:E$13),1))
    The col B interpolated column: =IF(J3<>J2,INDEX(B$3:B$13,MATCH(J3,D$3:D$13,0)-1),SUM(K2,(INDEX(B$3:B$13,MATCH(J3,D$3:D$13,0))-INDEX(B$3:B$13,MATCH(J3,D$3:D$13,0)-1))/J3))
    The col C interpolated column: =IF(J3<>J2,INDEX(C$3:C$13,MATCH(J3,D$3:D$13,0)-1),SUM(L2,(INDEX(C$3:C$13,MATCH(J3,D$3:D$13,0))-INDEX(C$3:C$13,MATCH(J3,D$3:D$13,0)-1))/J3))
    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.

  3. #3
    Registered User
    Join Date
    12-17-2020
    Location
    Maryland
    MS-Off Ver
    Excel for Mac v16.42
    Posts
    6

    Re: creating a table with variable numbers of rows

    thanks so much!

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,911

    Re: creating a table with variable numbers of rows

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools menu 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. [SOLVED] Creating a Table for showing Intervals between random numbers
    By wallygator1922 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-06-2019, 05:29 PM
  2. Creating Rows with Numbers According to Cell Value
    By loklok95 in forum Excel General
    Replies: 1
    Last Post: 11-06-2018, 05:24 AM
  3. VBA: Extract variable number of rows per variable number of phone numbers
    By redstone2830 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-17-2018, 09:22 PM
  4. [SOLVED] Creating Tables with Changing Numbers of Rows and Columns
    By rkorinko in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2014, 09:11 AM
  5. [SOLVED] Help using Names Ranges to sum data in rows across variable numbers of columns
    By azzurri825 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-15-2013, 05:15 AM
  6. Combining multiple rows into one row and creating new variable names
    By cat2000 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-15-2011, 06:07 PM
  7. Macro to sum numbers on variable rows
    By Nadir Soofi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-18-2008, 07:09 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