Your edit earlier this afternoon to your post-1 requirements significantly changes the problem and puts all subsequent posts out of context which may confuse subsequent readers. It might have been better if your changed requirements were documented as a new post rather than editing post #1
My sheets is actually on onedrive. I tried ur formula and it doesnt work on web sheets. Is there any alternative?
I'm afraid I know nothing about Google sheets. The functions I use look like they are available in Google sheets. What exactly was the problem you saw? Your profile says MS Office version is 2019. Is that accurate?
My post #2 formula (for the original "reset at 5" problem) had a problem - it didn't deal correctly with number sequences with NO 5's present. Here is the amended formula:
Formula:
=IFERROR(COUNT($C1:$W1) - LOOKUP(2,1/($C1:$W1=5), COLUMN($C1:$W1)-2), COUNT($C1:$W1))
real example: # 0.1 0.2 1 1.1 2 is the first row where '#' is blank, anything less than 1 should be counted and the first occurrence of 1 or above value resets the count and counter starts again from that spot onwards, while ignoring all before it.
# # 1.1 2 --> gives 2
0.1 # 0.2 2 --> gives 3
## 0.1 1.1 0.1 --> gives 1
if no other choice then i can replace all blanks with '0' too
Like with the original problem, you say:
"the first occurrence of 1 or above value resets the count"
so why does # # 1.1 2 give 2 and not 0 ?? Same question for 0.1 # 0.2 2 why does this give 3 and not 0?? Please clarify.
Assuming that you can replace all blanks with '0' and if you agree with my expected results then the formula above with just one minor chaage in red should work.
Formula:
=IFERROR(COUNT($C8:$W8) - LOOKUP(2,1/($C8:$W8>=1), COLUMN($C8:$W8)-2), COUNT($C8:$W8))
Put the formula in C8 and your numbers in row-8 starting at col-C.
Attached is a revised version of kvsrinivasamurthy's workbook.
Bookmarks