I have data like this where there's just two words I need to check at any time. I cant figure out how to count the duplicates but break the counting if there is another value inbetween.
| Column A | Desired Result |
|---|---|
| Apple | 1 |
| Apple | 2 |
| Apple | 3 |
| Pears | 1 |
| Pears | 2 |
| (No match value because empty cell - resets count) | |
| Pears | 1 |
| Pears | 2 |
| Apple | 1 |
| Pears | 2 |
=ArrayFormula(iferror(SORT(ROW(D3:D),SORT(ROW(D3:D),D3:D,1),1)-MATCH(D3:D,SORT(D3:D),0)-ROW()+1))
This counts as I expect, but doesnt break the chain and doesnt let me specify the words though that may not be a problem..