I have data like this and I would like to count the number of blank cells between each of two non-blank cells plus 1, like this:

I have data like this and I would like to count the number of blank cells between each of two non-blank cells plus 1, like this:

Since your entries in row 1 are numeric, in B2:
=IFNA(IF(B1,XMATCH(1,IF(C1:$XFD1,1)),""),"")
and copied right.