How to find the beginning and end of a sequence

TaskMaster

Board Regular
Joined
Oct 15, 2020
Messages
58
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Good morning,

I was wondering if anyone can assist me with the following query.

I have a date range in column A for days of the year and column B shows values of 1 or 0. Is there a formula that I can use that would tell me the start and end of a sequence where it shows 1's.

For example the output for the table below would be start 01/01/2022 End 02/02/2022, start 09/01/2022 end 10/01/2022.

DateActiveStartEnd
01/01/20221
02/01/20221
03/01/20220
04/01/20220
05/01/20220
06/01/20220
07/01/20220
08/01/20220
09/01/20221
10/01/20221
11/01/20220
12/01/20220
13/01/20220
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
How about
+Fluff 1.xlsm
ABCD
1DateActiveStartEnd
201/01/2022101/01/202202/01/2022
302/01/2022109/01/202210/01/2022
403/01/20220
504/01/20220
605/01/20220
706/01/20220
807/01/20220
908/01/20220
1009/01/20221
1110/01/20221
1211/01/20220
1312/01/20220
1413/01/20220
Lists
Cell Formulas
RangeFormula
C2:D3C2=LET(f,FILTER(A2:A14,B2:B14=1),INDEX(f,SEQUENCE(ROWS(f)/2,,,2)+{0,1}))
Dynamic array formulas.
 
Upvote 0
Hi Fluff,

Thank you for getting back to me so swiftly. As always you've absolutely nailed it, this is exactly what I was after!!!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,343
Messages
6,124,394
Members
449,155
Latest member
ravioli44

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