简体   繁体   English

Google 表格中的数组公式、连接和 If Function

[英]Array Formula, Concatenate, and If Function in Google Sheets

I have a formula to nicely format some data I need to combine.我有一个公式可以很好地格式化我需要组合的一些数据。

=IF(ArrayFormula(Isblank(Z2:AA2)), Y2, IF(Isblank(AA2), CONCATENATE(Y2, " ", "|", " ", Z2), CONCATENATE(Y2, " ", "|", " ", Z2, " ", "|", " ", AA2)))

How do I get this to automatically copy when a new row is added?添加新行时,如何使其自动复制? Data comes from a google form, so new rows will be added periodically, and I need this formula to be added to each new row.数据来自谷歌表单,因此会定期添加新行,我需要将此公式添加到每个新行中。 I tried adding arrayformula at the beginning, but got an error that it will overwrite data in the column to the right.我尝试在开头添加arrayformula,但出现错误,它将覆盖右侧列中的数据。 Thank you in advance!先感谢您!

try in row 2:在第 2 行尝试:

=ARRAYFORMULA(IF((Z2:Z="")*(AA2:AA=""), Y2:Y,
 IF(AA2:AA="", Y2:Y&" | "&Z2:Z,  Y2:Y&" | "&Z2:Z&" | "&AA2:AA)))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM