Just the count would do.

N12 should be 7. Row 1 of the same pair is used as the starting point of the counting. Technically, I need to count all the red cells...

Request you to refer to the latest file attached in my post 3.

Thank you Sir