ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Count consecutive dates only (https://www.excelbanter.com/excel-discussion-misc-queries/86818-count-consecutive-dates-only.html)

[email protected]

Count consecutive dates only
 
Running Excel 2003 on XP.
What would be the macro to *only* count the number of *consecutive*
rows from the max date backward (don't count any other rows) and get
the earliest date of that series in the final result? Here's a sample.
Thanks in advance for any tips/direction on this!
Input
ID Event Event Date
1 Create 4/21/06 (count)
1 Create 4/20/06 (count)
1 Create 4/19/06 (count)
2 Complete 4/21/06 (count)
2 Complete 4/20/06 (count)
2 Complete 4/19/06 (count)
2 Complete 7/05/05 (don't count)
2 Complete 7/04/05 (don't count)
2 Complete 7/03/05 (don't count)
3 Update 4/21/06 (count)
3 Update 9/13/05 (don't count)
3 Update 8/25/04 (don't count)

Desired Output
ID Event Since Date Count
1 Create 4/19/06 3
2 Complete 4/19/06 3
3 Update 4/21/06 1



All times are GMT +1. The time now is 10:06 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com