SOLVED

Counting in sequence with skipping

Copper Contributor

Counting in sequence with skipping

Hi,

I would like to set up a formula where the formula counts sequential (1,2,3,4,5...) on any "Yes" entry, but skips any "No" answer in a column. I would like to be able to count of the first 110 "Yes" without counting any "No" answer.

3 Replies

Re: Counting in sequence with skipping

=IF(A1="Yes",COUNTIF(\$A\$1:A1,"Yes"),"")

Does this return the expected result? The formula is in cell B1 and filled down.

best response confirmed by HansVogelaar (MVP)
Solution

Re: Counting in sequence with skipping

@OliverScheurich This is awesome, thank you so much, it works beautiful! Vielen Dank für die schnelle Hilfe :)

Re: Counting in sequence with skipping

As variant

=LET(
flag, --(data="Yes"),
count, SCAN(0,flag, LAMBDA(a,v, a+v)),
IF(flag, count, "")
)
1 best response

Accepted Solutions
best response confirmed by HansVogelaar (MVP)
Solution

Re: Counting in sequence with skipping

@OliverScheurich This is awesome, thank you so much, it works beautiful! Vielen Dank für die schnelle Hilfe :)