计算第一个空白的单元格数,然后在下一个空白之后重新开始计数

发布于 2025-01-27 20:09:50 字数 603 浏览 2 评论 0 原文

sheet = count i count i

column a a列a,列表作者列表。相互作用第一个A2是空白的,应计为B2中的1。然后,A3应导致B3显示2。A4应导致B4显示3。A5应导致B5显示4。A6应导致B5显示4。A6应导致B6显示5。A7是空白的,并应导致该a6重新开始,因此B7应为1,B8 = 2,B9 = 3,B10 = 4,B11 = 5,B12 =6。B13在测试数据中再次开始。

我正在使用的公式是:= arrayformula(if(if(a2:a =“”,row(a2:a)-row(a2)+1)) - 1)

此公式计数错误的方式,如3,2中,1而不是1,2,3,当应该为1时,还会给出空白单元0。

有什么想法吗?

https://docs.google.com/spreadsheets/d/1anfWAkxa73-N7TydeMXVRNTuA1UB-vJ9A3iEnDjXa-I/edit?usp=sharing

Sheet = Count

I have column A with a list of Author. Interactions the first A2 is blank and should be counted as 1 in B2. A3 should then result in B3 showing 2. A4 should result in B4 showing 3. A5 should result in B5 showing 4. A6 should result in B5 showing 4. A6 should result in B6 showing 5. A7 is blank and should result in the the count starting again, therefore B7 should be 1, B8 = 2, B9 = 3, b10 = 4, b11 = 5, b12 = 6. B13 starts again in the test data.

The formula I am using is: =ArrayFormula(MIN(IF(A2:A="",ROW(A2:A)-ROW(A2)+1))-1)

This formula counts the wrong way as in 3,2,1 instead of 1,2,3 and also gives the blank cell 0 when it should be 1.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绅刃 2025-02-03 20:09:50

使用:

=ARRAYFORMULA(ARRAY_CONSTRAIN(COUNTIFS(COUNTIFS(A2:A, "", 
 ROW(A2:A), "<="&ROW(A2:A)), COUNTIFS(A2:A, "", 
 ROW(A2:A), "<="&ROW(A2:A)), ROW(A2:A), "<="&ROW(A2:A)), 
 MAX((A2:A<>"")*(ROW(A2:A)))-1, 1))

use:

=ARRAYFORMULA(ARRAY_CONSTRAIN(COUNTIFS(COUNTIFS(A2:A, "", 
 ROW(A2:A), "<="&ROW(A2:A)), COUNTIFS(A2:A, "", 
 ROW(A2:A), "<="&ROW(A2:A)), ROW(A2:A), "<="&ROW(A2:A)), 
 MAX((A2:A<>"")*(ROW(A2:A)))-1, 1))

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文