![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Posts: 66
|
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 |
|
Board Regular
Join Date: Feb 2002
Location: Wisconsin - USA
Posts: 62
|
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. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|