[英]Google spreadsheets using ArrayFormula() to copy a formula into each row in the column as information is added and use data in corresponding row
I'm trying to copy a formula into each row of a column as the google sheet is attached to a google form that will keep importing data, and I only want the formula in each cell to use information from the cells in different columns in the same row however all the resources online that I've seen seem to only use Arrayformula to take all of the information added to one column and use it to calculate something in each cell, I only want information from the same row.我正在尝试将公式复制到列的每一行中,因为谷歌表附加到将继续导入数据的谷歌表单,我只希望每个单元格中的公式使用来自不同列中单元格的信息同一行但是我看到的所有在线资源似乎只使用 Arrayformula 将所有信息添加到一列并使用它来计算每个单元格中的内容,我只想要来自同一行的信息。 Here is the formula I want to add to each cell in the column.
这是我要添加到列中每个单元格的公式。
=IF(ISBLANK(G2), "",CONCATENATE(G2,"-",H2,"(",I2,")", " to ",G2,"-",H2,"(",J2,"), ",K2,", ",L2,", ",M2,", ",N2))
So for instance, if I was in cell C3 I would want to formula to reference G3, H3, I3, J3, K3, L3, M3 and N3 and not just concatenate all the values in all of G, H, I, J, K, L, M, and N like I experienced when trying to implement ARRAYFORMULA myself.例如,如果我在单元格 C3 中,我想通过公式来引用 G3、H3、I3、J3、K3、L3、M3 和 N3,而不仅仅是连接所有 G、H、I、J 中的所有值, K、L、M 和 N 就像我自己尝试实现 ARRAYFORMULA 时所经历的那样。
Here is what I had previously that didn't work:这是我以前没有工作的:
=ARRAYFORMULA(IF(ISBLANK(G2:G), "", CONCATENATE(G2:G, "-",H2:H,"(",I2:I,")", " to ",G2:G,"-",H2:H,"(",J2:J,"), ",K2:K,", ",L2:L,", ",M2:M,", ",N2:N)))
The concatenate function doesn't work when using arrayformula.使用 arrayformula 时,连接 function 不起作用。 You can however use the ampersand (&) to concatenate cells, so something like this:
但是,您可以使用与号 (&) 来连接单元格,如下所示:
=ARRAYFORMULA(IF(G2:G="","",G2:G & "-" & H2:H & "(" & I2:I & ")" & " to " & G2:G & "-" & H2:H & "(" & J2:J & "), " & K2:K & ", " & L2:L & ", " & M2:M & ", " & N2:N))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.