+ Reply to Thread
Results 1 to 3 of 3

[SOLVED] How to ask Excel carry on infinitely when it is right and stop once it is wrong?

  1. #1
    Registered User
    Join Date
    05-03-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    2

    Lightbulb [SOLVED] How to ask Excel carry on infinitely when it is right and stop once it is wrong?

    Sorry that I have the following problem:
    Now I've got the data of the left column (there are only yes and no in the column) and I hope to input a formulae to generate the right column.
    The rationale is like this:
    if left column is 'no', then the right column is 0
    if left column is 'yes', then:
    a. continue to check if the cell above is 'yes', if it is, value of right column plus one and repeat the process until a 'no' appears;
    b. if the cell above is 'no', then the right column is also 0.

    I understand it's a bit abstract, but thank you very much for answering my query!
    Attached Files Attached Files
    Last edited by barneylui; 05-03-2013 at 04:54 PM.

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: How to ask Excel carry on infinitely when it is right and stop once it is wrong?

    In order for this to work, row 1 needs to be a header row so that actual data starts in row 2. In then in cell B2 use this formula and copy down:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    05-03-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: How to ask Excel carry on infinitely when it is right and stop once it is wrong?

    it works!
    Thanks a lot!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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