首页 > 解决方案 > Google Sheets: Use ArrayFormula for JoinText for multiple columns

问题描述

I want to Use ArrayFormula for JoinText for multiple columns which have their own ArrayFormulas in Google Sheets. My formula works for columns that have plain text values but for some reason Google Sheets gives me an error when I apply it to columns that have their own ArrayFormulas applied to them.

Take a look at the example sheet I've created HERE

Any help will be appreciated!

标签: google-sheetsgoogle-sheets-formulaspreadsheet

解决方案


我希望这个带有查询的解决方案对您有所帮助:

=ArrayFormula(transpose(query(transpose(C1:D),,2)))

(如果您知道范围的限制,将会更快地工作,例如C1:D10)。


为了在列之间实现逗号,您可以使用

=ARRAYFORMULA(IF(C1:C="",D1:D,if(D1:D="",C1:C,C1:C&", "&INDIRECT("D1:D"))))


推荐阅读