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

google sheets - Using arrayformula to sum row if column is not empty - Stack Overflow

programmeradmin0浏览0评论

I have an arbitrary number of columns with values I'd like to sum if there is a date in A

Essentially, SUM C2:2 if A2 is not null

date Total col1 col2
03/02/2025 ? 15 234
02/02/2025 5 22
01/02/2025 23 3
31/01/2025 234

I have an arbitrary number of columns with values I'd like to sum if there is a date in A

Essentially, SUM C2:2 if A2 is not null

date Total col1 col2
03/02/2025 ? 15 234
02/02/2025 5 22
01/02/2025 23 3
31/01/2025 234

I have tried

=ARRAYFORMULA(IF(A2 = "", "", SUM(C2:2)))

However it doesn't loop down to the end of the dates

Share Improve this question edited Feb 6 at 12:15 Patsytalk 1,1171 gold badge1 silver badge15 bronze badges asked Feb 3 at 9:38 David AlshDavid Alsh 7,6858 gold badges43 silver badges79 bronze badges 1
  • Make sure to provide input and expected output as plain text table in the question. Check my answer or other options to create a table easily, which are easy to copy/paste. Avoid sharing links like spreadsheets, which make the question useless for others or images, which are hard to copy. Also, note that your email address can also be accessed by the public, if you share Google files. – TheMaster Commented Feb 3 at 10:02
Add a comment  | 

2 Answers 2

Reset to default 1

You may try:

=byrow(indirect("C2:"&rows(A:A)),lambda(Σ,if(index(A:A,row(Σ))="",,sum(Σ))))

You may try the following formula-

=MAP(A2:A,LAMBDA(x,IF(x="",,SUM(INDIRECT("C"&ROW(x)&":"&row(x))))))
发布评论

评论列表(0)

  1. 暂无评论