+ Reply to Thread
Results 1 to 2 of 2

How to generate filtered Vstack based on column list + Repeating rows based on Countif

  1. #1
    Registered User
    Join Date
    09-21-2024
    Location
    Toronto,Canada
    MS-Off Ver
    Microsoft 365
    Posts
    1

    How to generate filtered Vstack based on column list + Repeating rows based on Countif

    Hi all,
    Hope someone can help please.
    I have attached three Files:
    File 1 lists a column of Room ID's (differentiated by plan and elevation) which each need specific types of Products.
    File 2 lists all Possible Room ID's and what each Product every Room ID needs.
    File 3 partially shows the data desired (but I came up with this through basic filter function and copy/paste)


    I would like excel to create an expanded version of these two files which lists the products needed in every Room ID in each plan and elevation.

    1.) I would like to generate Vstack/s of the data in File2, filtered successively on all the Room IDs listed in File1.
    Starting from the top row 2 (Q30D-EM-BATH), I would like Excel to create a vstack of File2 Filtered for RoomID:BATH,
    then on row 3 (Q30D-MO-BATH) filtered for RoomID: BATH,
    then row 4 (Q30D-EM-BATHALT) filtered for RoomID: BATHALT,
    then row 5 (Q30D-TA-BATHPRIMALT) filtered for RoomID: BATHPRIMALT,
    and so on...
    I would like Excel to list the results in successive arrays / vstacks.

    2.) Then right beside this long list is another array/ multiple vstack where Excel exactly first repeats Row2 in File1 (Including Plan, Elev and Room ID data) according to the number of times the RoomID in Row2-File1 appears in the RoomID-File2.
    Starting from the top, by evaluating that RoomID:Bath in the top row of File1 (Q30D-EM-BATH) appears 9 times in RoomID-File2, Excel creates a list repeating Q30D-EM-Bath 9 times.
    Then evaluating row 3 in File1 (Q30D-MO-Bath), adds Q30D-MO-Bath in the next 9 rows,
    then evaluating row 4 in File1 (Q30D-EM-Bathalt), adds / repeats Q30D-EM-Bathalt in the next 9 rows,
    then evaluating row 5 in File1 (Q30D-TA-BATHPRIMALT), adds Q30D-TA-BATHPRIMALT in the next 16 rows,


    3.) File 3 partially shows the data desired where 1 and 2 are combined (but I came up with this through basic filter function and copy/paste).

    Hope someone here can help!

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2507 Build 16.0.19029.20136) 64-bit
    Posts
    31,549

    Re: How to generate filtered Vstack based on column list + Repeating rows based on Countif

    Please Login or Register  to view this content.
    "File2.xlsx" has sheet "Sort_by_ID" which is sorted version of Sheet1
    "File1.xlsx" must be open

    It would be "easier" is all the data was in a single file rather than separate files.
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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] Combine VSTACK + SORT + FILTER + CHOOSECOLS to generate list
    By pfusella in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-13-2024, 04:36 PM
  2. [SOLVED] Generate a table with repeating values based on input parameter
    By HighGoblinInvestigat in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-18-2024, 04:19 PM
  3. Filtered list from array based on unique rows and maximum value of a column
    By chullan88 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-30-2023, 04:36 PM
  4. [SOLVED] Generate unique list of values based on condition in another table column with VBA
    By dabasir in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-16-2019, 09:12 PM
  5. [SOLVED] Add based on data of another column in filtered list
    By Margate in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-14-2018, 04:06 PM
  6. [SOLVED] Index and match based off of top 5 list for a specific field in a filtered column
    By ScottBeatty in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-27-2013, 04:37 PM
  7. Replies: 3
    Last Post: 03-21-2013, 09:28 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