简体   繁体   English

谷歌电子表格使用 ArrayFormula() 在添加信息时将公式复制到列中的每一行并使用相应行中的数据

[英]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.

相关问题 使用Google表格上的ArrayFormula逐行检查COUNTIF - Check row by row COUNTIF using ArrayFormula on Google Sheets 将每行中的非空单元格与谷歌表格中的 arrayformula 连接起来 - Concatenate non empty cells in each row with arrayformula in google sheets NPM Google 电子表格错误:每一行必须是 object 或数组 - NPM Google Spreadsheets Error: Each row must be an object or an array Arrayformula 与锁定列在同一行中求和 - Arrayformula sum in the same row with locked column PHP使用fputcsv CSV在每一行的列中写入相同的数据 - PHP use the fputcsv CSV to write same data in column for each row 将一行的公式复制到谷歌应用程序脚本中的多行 - Copy one row's formula to multiple rows in google apps script 在Java中使用iText按列填充每一行列的动态数据 - Fill the dynamic data with each row columns by column Using iText in Java 是否可以使用单个 Google 表格公式将一列文本值转换为没有重复的单行? - Is it possible to transpose a column of text values into a single row without duplicates, using a single Google Sheets formula? google gsheets 数组公式偏移量(引用同一列中的前一行) - google gsheets array formula offset (referencing previous row in same column) 使用数组改变 Excel 公式中偏移量中的行/列 - Use array to vary the row/column in an offset in Excel formula
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM