+ Reply to Thread
Results 1 to 5 of 5

Generate a table with repeating values based on input parameter

  1. #1
    Registered User
    Join Date
    04-17-2024
    Location
    New York
    MS-Off Ver
    Excel ver 2403
    Posts
    2

    Generate a table with repeating values based on input parameter

    Hello,

    I'm trying to make a table where you type input dates, and based off the data in some pre-existing tables, a table would populate that would look like this:

    template.png

    Per day, all the times, and each time repeated for each venue.
    I would like this to be formula-based, since the number of venues may update to be more than 3, meaning there would now be 4 rows per date-and-time. Any idea what the formulas should be per column to achieve this?
    Thank you for any help.
    -Hugh Goblin

    test book.xlsx
    Last edited by HighGoblinInvestigat; 04-18-2024 at 11:14 AM.

  2. #2
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,894

    Re: Generate a table with repeating values based on input parameter

    I'd really recommend using Power Query to do this.

    But if you need to use formula...

    Method 1:
    In some empty range: Note that I converted Venue list to table.
    Please Login or Register  to view this content.
    Then copy result as values into range.
    Then use Text to columns on range and split by "|". Apply format and sort as desired.

    Method 2:
    First cell of Date column.
    Please Login or Register  to view this content.
    First cell of Times.
    Please Login or Register  to view this content.
    First cell of Venue.
    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  3. #3
    Registered User
    Join Date
    04-17-2024
    Location
    New York
    MS-Off Ver
    Excel ver 2403
    Posts
    2

    Re: Generate a table with repeating values based on input parameter

    Thank you. If it's not too much trouble, could you explain the logic behind how these functions work? Looking to expand my understanding.
    -Hugh

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,765

    Re: Generate a table with repeating values based on input parameter

    Do you want every date between the start and end date, or just those two dates?

    Pete

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,894

    Re: Generate a table with repeating values based on input parameter

    @Hugh

    SEQUENCE is used to generate list of sequential number in array...
    In Excel, dates are stored as # of days since 12/31/1899. 1 = 1/1/1900.

    So by using SEQUENCE(EndDate - StartDate + 1,,StartDate,1), you'd create list of dates staring from start date to end date. +1 is used to make # of dates inclusive.

    Then IF function is used to generate multiple copies of this array.
    Please Login or Register  to view this content.
    IF will treat any non-zero numbers as TRUE implicitly. And since you are passing array as logical condition... result will be replicated by number of columns you specify in SEQUENCE.

    TOCOL is used to transform array into single column.

    In Times column, TOCOL is separated into 2 steps, so that you first repeat Time by number of Venue. Then outer TOCOL uses TRUE in 3rd argument to tell it to scan the array by column to preserve column wise sort (otherwise you'll have result that sorts by numeric order of Time).

    Hope that explains it.

+ 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. Generate a list based on parameter
    By artistapart in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-15-2016, 10:51 AM
  2. [SOLVED] Need help on repeating values in columns based on the table people count
    By elayaz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-13-2016, 08:32 AM
  3. Replies: 1
    Last Post: 10-24-2013, 08:58 AM
  4. Replies: 0
    Last Post: 03-28-2013, 02:41 AM
  5. Replies: 2
    Last Post: 12-14-2012, 01:17 PM
  6. Instantly change column values after copy/insert rows based on input - Selection parameter
    By BuzzOffSweetheart in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-20-2012, 09:47 AM
  7. Repeating rows based on parameter setting
    By rowlandrat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-11-2011, 04:48 AM

Tags for this Thread

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