+ Reply to Thread
Results 1 to 5 of 5

Creating an array based on different variables

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    48

    Question Creating an array based on different variables

    Hi, I have run into a little problem which I could use some help with.

    I have table with a column with an ID (#) and column with a count. I'd like a dynamic array from this table where the ID (#) is repeated as many times as the count in the same row.
    I added an example in attachement, but it's not dynamic at the moment. Adding more rows to the table should extend the array automatically.

    Any ideas?

    example.xlsx

  2. #2
    Forum Contributor
    Join Date
    08-19-2024
    Location
    Philippines
    MS-Off Ver
    MS365 for Business
    Posts
    113

    Re: Creating an array based on different variables

    One way:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-21-2012
    Location
    Netherlands
    MS-Off Ver
    365
    Posts
    48

    Re: Creating an array based on different variables

    Interesting approach, thanks! It does however make an array much larger than needed with empty rows.

    With the warning message up top not to post AI generated solutions I was I inspired to try and find a solution there too. Surprisingly it did come up with a solution that works.
    Per regulation I will not post that solution. It also used a TOCOL followed BYROW and SEQUENCE.

    I knew about TOCOL but it never came up as a considertion to use it.

  4. #4
    Forum Contributor
    Join Date
    08-19-2024
    Location
    Philippines
    MS-Off Ver
    MS365 for Business
    Posts
    113

    Re: Creating an array based on different variables

    Quote Originally Posted by Sthlm View Post
    It does however make an array much larger than needed with empty rows.
    No, it doesn't. See attached...

    Blank records in the table "Count" column are treated as 0's. 0 is NOT greater than or equal to SEQUENCE(, MAX(Table1[Count])), so the 0's will return #N/A errors by default with the IFS function. The optional [ignore] argument of TOCOL is set to 2, so it will ignore/remove the errors.
    Attached Files Attached Files

  5. #5
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2503 and WPS V2024(12.1.0.18543)
    Posts
    3,952

    Re: Creating an array based on different variables

    Cell d2 formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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 an array with existing variables
    By airygirl in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-21-2021, 02:26 PM
  2. Creating automated values based on two other variables
    By kchick118 in forum Excel General
    Replies: 12
    Last Post: 12-17-2020, 04:27 PM
  3. Creating a Dynamic Chart Based on Variables
    By nohmis in forum Excel General
    Replies: 4
    Last Post: 01-03-2019, 09:07 PM
  4. HALP! Creating a number of variables based on a variable.
    By MarmaladeLover in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-23-2014, 10:06 AM
  5. Creating table using equation based on three variables.
    By canunu1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-28-2013, 07:08 PM
  6. Creating folderpaths based on variables
    By TonyforVBA in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-24-2011, 06:18 AM
  7. Creating variables based on cell location
    By length in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2009, 01:10 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