+ Reply to Thread
Results 1 to 3 of 3

Stop after first match of IF condition

  1. #1
    Forum Contributor
    Join Date
    06-30-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    251

    Stop after first match of IF condition

    Hi,

    I have a time series for a portfolio, where rows reflect individual tickers and columns reflect dates. My goal is to populate column BF on the attached, which represents the first instance of a date being 0 (working backward from column BD).

    In cases where the most recent date is 0, I'd like to display N/A in column BF, and in cases where no 0 exists, I'd like to revert back to the very first date (column C). I'm still pretty new, but it seems like that this might all be accomplished utilizing an IF statement, however, my question was more about the structure of the loop when the first condition is true.

    I'm still in debugging mode, but the way the code is written now, it continues to print the addresses of cells that equal 0 beyond the first one. How can i structure the code so that it only picks up the very first 0, then moves on to the next row (i.e., in the first row example on the attached, it would print AO11 as the address and subsequently move to row 12).

    So far, I have the below:

    Please Login or Register  to view this content.
    Appreciate any and all help. Thanks.
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,620

    Re: Stop after first match of IF condition

    Please Login or Register  to view this content.
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    06-30-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    251

    Re: Stop after first match of IF condition

    Thank you so much for this. In hindsight, I think I need to go back to the drawing board in how i structure my if statements. Very much appreciate the 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. [SOLVED] Condition Forumula if Columns have Strings and if they match to preset condition
    By rosn.dhakal in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-02-2018, 10:57 PM
  2. [SOLVED] Stop macro if condition not met
    By hazzaska in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-01-2017, 11:58 AM
  3. [SOLVED] Stop Calculation once a condition is met
    By stulesley in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-15-2017, 08:57 AM
  4. [SOLVED] Stop for loop at certain condition
    By atomichybrid in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-06-2014, 07:34 PM
  5. [SOLVED] Stop Macro if Condition Met
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-30-2014, 11:15 AM
  6. Stop calculation once a condition is met
    By ryefield in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-01-2013, 07:30 PM
  7. STOP calculation after a condition has been met?
    By ryefield in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2013, 07:24 PM

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