Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Consecutive entries in range

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Posts
    71
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    G1 contains function "TODAY". C8:C500 represent consecutive dates, eg C8 is 4/1/02, C9 is 4/2/02. Each day, cell will remain blank or be marked with an "x". I need a formula which will return the number of consecutive "x's" as of today. For instance, if today is April 15 (C22), and C20 is blank, while C21 and C21 contain "x's", the formula would return "2". If today's entry is blank, the formula would return "0". The concept is like a "winning streak" number in the baseball standings, for you sports fans.

    Any help will be greatly appreciated.

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Wisconsin - USA
    Posts
    62
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    your best bet is to build a macro that will loop through each row & column & count the number of X's. Then, once you do reach an empty cell, stop the column loop - report the number of consecutive X's for that row, and continue to the next row.

    For intRow to LastRow
    For intColumn to LastColumn


    Next
    Next

    you can trigger this macro to run via a menu option or a button on the sheet.
    Best of luck.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •