Return Consecutive Days Count or Zero

Kimberly24

New Member
Joined
Aug 20, 2015
Messages
7
Hello,
In Excel I have a Date column and a Flagged column. The flagged column is a "1" or a "0" based on information from a different source. I need to make a column that will return "0" if the flagged column is "0" BUT if the flagged column is "1" then I need it to return how many consecutive "1"'s are in that string.

DATE FLAGGED OUTPUT
1/1/2016 1 1
1/2/2016 0 0
1/3/2016 1 4
1/4/2016 1 4
1/5/2016 1 4
1/6/2016 1 4
1/7/2016 0 0
1/8/2016 0 0
1/9/2016 1 2
1/10/2016 1 2

I have reviewed some similar threads on the subject but I was not able to tweak them to match my exact needs yet. Thanks in advance for any assistance!
KC
 
That's true, until the new lines are populated with data (and the formula copied down from the line above the inserted row(s)).
Except if the inserted row or rows occur at Row 1 (in front of the headers). By the way, my pointing this out is not meant to be criticism of your formula (I like it), but, rather, to provide the OP with information she may not be aware of.
 
Last edited:
Upvote 0

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
No worries.

Your macro solution isn't too bad either.

Provided it is rerun after row insertions/deletions... :biggrin:
 
Upvote 0

Forum statistics

Threads
1,216,175
Messages
6,129,305
Members
449,499
Latest member
HockeyBoi

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