I need a macro or formula that can do this:

```
Column A Values:

1
1
1
2
2
2
3
3
4
4
4
5
5
6
6

```

I need Column B to do:

```
1
2
3
1
2
3
1
2
1
2
3
1
2
1
2

```

Because column B has to have an increment number while column A has the same repeated value (for example `1 1 1 2`), when it changes (to 2 or 3 etc.) the counter on column B has to reset and increment itself while A repeats the next value (`1 2 3 1`)

*Thanks*