# Excel formula to Automatically put series on Patterns

#### Shinianne

##### New Member
Hi,

I'd like to ask help with excel.
Is it possible to detect which comes first?

example:

John smith took his break 3 times a day, how can i identify the first break and the other 2, like is it possible that a formula can Make it like Break 1, Break 2, Break 3?

##### Active Member
Hi Shinianne,

There a few ways to do this but here's one which assume you have the data in time sequence. If I didn't guess near your actual data format then you can copy&paste an example of your data to help.

Book1
ABCD
1NameActionTimeBreaks
2Sarah JonesClocked In8:25
3Sarah JonesHelp Desk8:27
4John SmithClocked In8:30
5John SmithHelp Desk8:32
6Alf GreenClocked In8:34
7Alf GreenHelp Desk8:45
8John SmithBreak11:30Break 1
9Sarah JonesBreak12:22Break 1
10Sarah JonesHelp Desk13:05
11John SmithBreak13:20Break 2
12Alf GreenBreak14:17Break 1
13John SmithHelp Desk15:15
14Alf GreenBreak16:09Break 2
15John SmithBreak16:12Break 3
16Sarah JonesClocked Out17:22
17John SmithClocked Out18:08
18Alf GreenClocked Out18:22
Sheet1
Cell Formulas
RangeFormula
D2:D18D2=IF(B2="Break","Break "&COUNTIFS(\$A\$2:\$A2,A2,\$B\$2:\$B2,"Break"),"")

#### Shinianne

##### New Member
OMG! yes it's working thank you so much sir, I greatly appreciate it so much! thank you!

#### Shinianne

##### New Member
Hi Shinianne,

There a few ways to do this but here's one which assume you have the data in time sequence. If I didn't guess near your actual data format then you can copy&paste an example of your data to help.

Book1
ABCD
1NameActionTimeBreaks
2Sarah JonesClocked In8:25
3Sarah JonesHelp Desk8:27
4John SmithClocked In8:30
5John SmithHelp Desk8:32
6Alf GreenClocked In8:34
7Alf GreenHelp Desk8:45
8John SmithBreak11:30Break 1
9Sarah JonesBreak12:22Break 1
10Sarah JonesHelp Desk13:05
11John SmithBreak13:20Break 2
12Alf GreenBreak14:17Break 1
13John SmithHelp Desk15:15
14Alf GreenBreak16:09Break 2
15John SmithBreak16:12Break 3
16Sarah JonesClocked Out17:22
17John SmithClocked Out18:08
18Alf GreenClocked Out18:22
Sheet1
Cell Formulas
RangeFormula
D2:D18D2=IF(B2="Break","Break "&COUNTIFS(\$A\$2:\$A2,A2,\$B\$2:\$B2,"Break"),"")
You have resolved my query! thank you so much

##### Active Member
You're welcome and thanks for the response.