+ Reply to Thread
Results 1 to 8 of 8

Looping an Array Formula for Multiple rows

  1. #1
    Registered User
    Join Date
    08-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    7

    Looping an Array Formula for Multiple rows

    Hello,

    I wanted to do a multiple return vlookup so I used an Index formula. I have account names and am trying to vlookup contacts associated with those accounts (4 max). So I have a list of Accounts all with 3 blank rows in between them. How do I loop an array formula? So far I have the code..

    Please Login or Register  to view this content.
    This finds the 4 contacts associated with the first account in C5 which I named the cell "myVar". I now want it to find the contacts associated with the accounts in C9, C13, C17 and so on until the first empty cell.

    Help please!
    Last edited by Leith Ross; 04-04-2014 at 08:20 PM. Reason: Added CodeTags

  2. #2
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Looping an Array Formula for Multiple rows

    Hi,

    Welcome to the forum

    Please note: The code below is air code! I have not tested or tried it in Excel.
    Please test on a copy of your file...

    Please Login or Register  to view this content.
    Regards,
    Rudi

  3. #3
    Registered User
    Join Date
    08-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Looping an Array Formula for Multiple rows

    Thanks, Rudi! This totally worked! I changed the R[-4],R[-3] to R1,R2 to make it constant and it's awesome. Just figuring out how to drop down the formula to the rows below it.
    Last edited by captainangela; 04-07-2014 at 01:46 PM.

  4. #4
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Looping an Array Formula for Multiple rows

    Yes R1,R2 is good..a bit of an oversight on my part.

    I'm not sure what you mean by drop down the formula to the rows below it? Is it not simply supposed to occur every fourth row?
    If you need further assistance, please elaborate.
    TX

  5. #5
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Looping an Array Formula for Multiple rows

    Yes R1,R2 is good..a bit of an oversight on my part.

    I'm not sure what you mean by drop down the formula to the rows below it? Is it not simply supposed to occur every fourth row?
    If you need further assistance, please elaborate.
    TX

  6. #6
    Registered User
    Join Date
    08-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Looping an Array Formula for Multiple rows

    Hi Rudi,

    So it worked perfectly that the formula appeared in every 4th row.

    For dragging down the formula: for instance, in C4 I have an Account Name, "Angela's Bakery". Then in D4, D5, D6, and D7 I am using the array formula to find the 4 contacts associated with Angela's Bakery. So the formula would produce in D4 - "Angela", in D5 - "John", in D6 - "Evan", and D7 - "Julie".

    I've tried FillDown and AutoFill but most things I've found are till the last row, but I only want it till the next Account Name. Also, When the formula drags down, the Account Name (=RC[-1]) needs to stay constant for those 4 rows. Since C9 would say something like "Jim's Bakery" and there would be 4 new contacts associated with that for D8,D9,D10,D11.

    Please let me know if I am not explaining clearly.

  7. #7
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Looping an Array Formula for Multiple rows

    Sorry...I must admit that I did overlook those necessary details.
    Try this version now...

    Please Login or Register  to view this content.
    Please note that I got assistance to help solve this from an MVP in Eileen's Lounge, here: http://www.eileenslounge.com/portal.php

  8. #8
    Registered User
    Join Date
    08-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Looping an Array Formula for Multiple rows

    This is perfect! Thank you so much! I will be sure to check out Eileen's Lounge as well!

  9. #9
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Looping an Array Formula for Multiple rows

    You're welcome.
    Glad to help

+ 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. Index match function without array formula for multiple rows.
    By markb141 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-29-2014, 10:35 AM
  2. [SOLVED] Looping the rows of an Array into a one range of rows repeatedly
    By Romulo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2013, 10:54 AM
  3. [SOLVED] Sum multiple entire rows based on criteria, array formula challenge!
    By ppffffpp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-10-2012, 09:42 PM
  4. Looping An Operation Through Multiple Worksheets Using An Array
    By Authentik8 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-12-2012, 10:04 AM
  5. VBA Web Query Macro, Offset Multiple Rows Looping
    By huey in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-30-2009, 06:42 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