+ Reply to Thread
Results 1 to 4 of 4

How to Loop a Formula with a Variable

  1. #1
    Forum Contributor
    Join Date
    09-06-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    225

    Exclamation How to Loop a Formula with a Variable

    I am trying to put the following formula into a loop:

    =AND(Di <>"", Di >= Ei)

    Where i is = iIndex

    Below is what I have so far but it isn't working. Please assist.

    Please Login or Register  to view this content.
    Thank you,

    Nick

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: How to Loop a Formula with a Variable

    Hi,

    If all you're trying to do is add a formula to column I where the number of rows varies, just use a variable to identify the last row, (you could use

    Please Login or Register  to view this content.
    Then rather than use a loop, (which are always slower than standard Excel functions), just add your formula to I2,

    Please Login or Register  to view this content.
    and then use

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,523

    Re: How to Loop a Formula with a Variable

    I don't know if I understood it right but is this what you have in mind?


    Please Login or Register  to view this content.
    Or

    Please Login or Register  to view this content.
    Sorry Richard. Had not seen your reply.

  4. #4
    Forum Contributor
    Join Date
    09-06-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    225

    Re: How to Loop a Formula with a Variable

    Thank you to both of you. I appreciate both tactics towards doing this, as they've provided insight for my future projects.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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