Consecutive entries in range

Ludovico

Board Regular
Joined
Apr 3, 2002
Messages
71
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.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
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.
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,213
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top