最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Sum the continuity in columns of Google sheet - Stack Overflow

programmeradmin1浏览0评论

Sheets -> Google Sheets (not PC Excel)

I want the answer to columns C and D as 3 (separately under their columns) due to their continuity. What would be its formula?

I mean, as long as the data is the same in a column, it is counted as one entry. Gaps could be longer, but there must be one cell to differentiate/break continuity

EDIT: Columns C & D are just examples, so need answer to column C separately and D separately.

Sheets -> Google Sheets (not PC Excel)

I want the answer to columns C and D as 3 (separately under their columns) due to their continuity. What would be its formula?

I mean, as long as the data is the same in a column, it is counted as one entry. Gaps could be longer, but there must be one cell to differentiate/break continuity

EDIT: Columns C & D are just examples, so need answer to column C separately and D separately.

Share Improve this question edited Feb 4 at 6:20 eagle asked Feb 4 at 5:51 eagleeagle 8532 gold badges10 silver badges28 bronze badges 1
  • Kindly share with us what are the basis of the values of column C and D? Would you be able to provide your sample sheet, with your initial output, and also your expected output so that we can further help you. You may use this to provide a markdown table (you may create one with the help of this link or an anonymous sample spreadsheet (using this link – EL SRY Commented Feb 4 at 6:01
Add a comment  | 

1 Answer 1

Reset to default 2

You need COUNTIFS(). Try-

=COUNTIFS(C:C,TRUE,D:D,TRUE)

Edit: After comments by OP. SCAN() function may work. Try-

=MAX(SCAN(0,C1:C,LAMBDA(a,x,IF(AND(x=TRUE,x<>OFFSET(x,1,0)),a+1,a+0))))

for D Column-

=MAX(SCAN(0,D1:D,LAMBDA(a,x,IF(AND(x=TRUE,x<>OFFSET(x,1,0)),a+1,a+0))))
发布评论

评论列表(0)

  1. 暂无评论