+ Reply to Thread
Results 1 to 6 of 6

Iterate through a column recursively

  1. #1
    Registered User
    Join Date
    08-27-2014
    Location
    Santos
    MS-Off Ver
    2010
    Posts
    4

    Iterate through a column recursively

    Hi

    How to create a formula that is circular to go through an array and return to the beginning when it reaches the end of it?

    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    02-10-2019
    Location
    Georgia, USA
    MS-Off Ver
    Office 365
    Posts
    3,030

    Re: Iterate through a column recursively

    Are you still on Version 2010? If not, please update your profile so we know what formulas are available to you.
    Also, it's best to attach a sample workbook, with mocked up answers so we can test our results.
    I don't understand your question without more detail (sample workbook).

  3. #3
    Registered User
    Join Date
    08-27-2014
    Location
    Santos
    MS-Off Ver
    2010
    Posts
    4

    Re: Iterate through a column recursively

    Yes I am still on Version 2010


    Names

    Paulo
    Luis
    Armstrong
    Celine
    Julia
    Richard
    Nathaniel
    Jackson
    Merly


    Column A has 170 names. Sometimes I need to select 20 names starting from row 160. This search only ends when the selection reaches the first names in the array.
    What formula should I use to return to the beginning of the array?

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2407
    Posts
    25,973

    Re: Iterate through a column recursively

    I think you misunderstand what "recursive" means. The term you are looking for is "wrap around."

    I think you also misunderstand "sample workbook." It's pretty clear that you have names in column A but we have no idea how you will indicate how many names you want, what row to start in, or where to put the results. What do you mean by "select"? Do you mean literally select the cells? Or do you mean generate a list?

    I have attached a sample file to illustrate what I am guessing you want.

    (I understand people have various constraints but 2010 is getting pretty old and problems like this could be solved in in the latest version very simply.)
    Attached Files Attached Files
    Last edited by 6StringJazzer; 09-30-2024 at 11:45 PM.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  5. #5
    Registered User
    Join Date
    08-27-2014
    Location
    Santos
    MS-Off Ver
    2010
    Posts
    4

    Re: Iterate through a column recursively

    Thanks Mr 6StringJazzer
    Sorry for my poor english

  6. #6
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2019
    Posts
    3,923

    Re: Iterate through a column recursively

    Alternatively, using the volatile OFFSET formula:
    =IF(COUNTA(G$1:G1)>$E$2,"",OFFSET($B$1,IF($E$3+ROWS(B$2:B2)<=COUNTA(B:B),$E$3+ROWS(B$2:B2)-1,ROW(B2)-ROW(B$1:B1)-(COUNTA(B:B)-$E$3)),0))
    Attached Files Attached Files

+ 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. Macro to iterate through rows and column to transpose data
    By uni4c in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2024, 08:05 AM
  2. VBA to search recursively
    By CDandVinyl in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-02-2023, 04:44 PM
  3. Want to iterate code on entire column as opposed to single cell
    By ilovepeanutbutter in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-18-2020, 04:30 PM
  4. Replies: 4
    Last Post: 10-21-2019, 02:10 PM
  5. [SOLVED] Iterate through row and then msgbox if value in column exceeds a set number
    By ihb95 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-01-2019, 07:12 AM
  6. [SOLVED] Iterate a formula down a column, restarting 4 cells after an 'event'
    By Supersadie in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-06-2018, 06:41 PM
  7. Recursively matching sums?
    By michaelswhitehe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2006, 10:17 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