Forum Discussion
Morgul
Apr 26, 2025Copper Contributor
formula to count cells between same values
hi everyone i am looking for a formula that would count cells between cells with same value for example Column A looking for the number between cells having 2 as value so first answer would be 10 as ...
HansVogelaar
Apr 29, 2025MVP
This works best if the data start in A2 (with a header in A1, for example).
In B2:
=IFERROR(ROW($A2)-XMATCH($A2, $A$1:$A1, , -1), 0)
Fill down.