+ Reply to Thread
Results 1 to 7 of 7

Loop function to stack selective data

Hybrid View

Chetan Chauhan Loop function to stack... 11-22-2022, 09:35 AM
Glenn Kennedy Re: Loop function to stack... 11-22-2022, 09:39 AM
Glenn Kennedy Re: Loop function to stack... 11-22-2022, 09:51 AM
Chetan Chauhan Re: Loop function to stack... 11-22-2022, 10:46 AM
Glenn Kennedy Re: Loop function to stack... 11-22-2022, 11:39 AM
Chetan Chauhan Re: Loop function to stack... 11-23-2022, 05:03 AM
Glenn Kennedy Re: Loop function to stack... 11-23-2022, 05:16 AM
  1. #1
    Registered User
    Join Date
    07-27-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    53

    Lightbulb Loop function to stack selective data

    Hi All,

    In the attached sheet, first one is my original data. I am trying to use loop function which will filter values only for each column until "SRB" header and copy paste the Identifier & Filter column values in sheet "Consolidate". The loop function should stack the values in Consolidate sheet.

    Please find the result required in Consolidate sheet. Any help is appreciable.

    Regards,
    Chetan
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Loop function to stack selective data

    Hi. Before we get going on this one...

    Is your forum profile showing the Excel PRODUCT that you need this request to work with?

    The best solutions often rely on knowing WHICH Office PRODUCT (Excel, NOT Windows) that you have. Please check that your forum profile is up-to-date. If you aren't sure, in Excel go to File/Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this.

    The three most recent Excel PRODUCTS are Excel 2019, Excel 2021 and MS365 - if you are using MS365, please give this name along with the Version number in your profile (e.g. MS365 (PC) Version 2211). The version number is in the About Excel section further down the Account page.

    Cheers,

    Glenn.
    Attached Images Attached Images
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Loop function to stack selective data

    No reply. So, I have assumed that you are now up to date and have O365.

    Formula: copy to clipboard
    =LET(d,Original!A1:A21,rd,ROWS(d),q,Original!B1:I21,
    QL,TOCOL(TRIM(q),,1),r,ROWS(QL),
    DL,INDEX(d,1+MOD(SEQUENCE(r,,0),rd)),
    FILTER(HSTACK(DL,QL),QL<>""))
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    07-27-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Loop function to stack selective data

    Thanks Glenn and yes its O365 The function works when row & column are defined.
    For me column and row are both dynamic(was not clear in first ask). Header may fall off if no value is there. I want loop to check till SRB as that is constant and get the result.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Loop function to stack selective data

    OK. Modified to exclude header when there are no values below:

    Formula: copy to clipboard
    =LET(d,Original!A1:A21,rd,ROWS(d),q,FILTER(Original!B1:I21,BYCOL(Original!B2:I21,LAMBDA(x,IF(COUNTA(x)>1,1,0)))),
    QL,TOCOL(TRIM(q),,1),r,ROWS(QL),
    DL,INDEX(d,1+MOD(SEQUENCE(r,,0),rd)),
    FILTER(HSTACK(DL,QL),QL<>""))


    Note, in particular, the values in RED.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-27-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Loop function to stack selective data

    Thanks, that works.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Loop function to stack selective data

    Please amend your profile, as you're not using Excel 2003.

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) 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] Selective Adding Function
    By JonSalzman in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-05-2016, 10:49 PM
  2. selective function
    By Mahmoud_El.Attar in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-12-2012, 05:45 AM
  3. Selective Count function
    By greggga in forum Excel General
    Replies: 1
    Last Post: 05-15-2009, 10:49 AM
  4. Current function is at the top of the stack
    By flee01 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-25-2008, 09:14 AM
  5. Selective function if cell empty/full
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-31-2008, 05:04 AM
  6. Selective/Looping substraction function
    By SER01 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-06-2007, 05:19 AM
  7. error 28: out of stack space call function
    By ina in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-24-2006, 02:30 PM

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