简体   繁体   English

谷歌表数组公式拆分和导入范围

[英]google sheets array formula split and import range

I am trying to construct quite a complex formula but for now, without success, I will appreciate any help!我正在尝试构建一个相当复杂的公式,但目前没有成功,我将不胜感激! First some context I am trying to synchronize the sheets that stores answer from google forms with other sheets to make a summary so I have for example 3 sheets synchronized with 3 different forms all have a column named student code (it is not named range just a value in the first row).首先是一些上下文我试图将存储来自谷歌表单的答案的表单与其他表单同步以进行汇总,因此我有例如与 3 个不同表单同步的 3 个表单都有一个名为学生代码的列(它不是命名范围只是一个第一行的值)。 then I have created by another formula comma-separated list of the spreadsheet relevant for the user (for example I know that student 1 is in exercise abc so I get links of all of the spreadsheets into the appropriate cell as a comma-separated String) so what I want to achieve然后我通过另一个公式创建了与用户相关的电子表格的逗号分隔列表(例如,我知道学生 1 正在练习abc因此我将所有电子表格的链接作为逗号分隔的字符串放入适当的单元格中)所以我想要达到的目标

  1. import range from each relevant spreadsheet I am trying to achieve this through the formula从每个相关电子表格导入范围我试图通过公式实现这一点

=Arrayformula(Filter(IMPORTRANGE(SPLIT(AB2, ",", TRUE, TRUE),"'Form responses 1'!A1:Z1000")))

but without success但没有成功

  1. get the first row from this tables从此表中获取第一行
  2. filter the row that I have a student code (the column named studCode with a value of appropriate student code)过滤我有学生代码的行(名为studCode的列,具有适当的学生代码值)
  3. join rows from all of those operations so I will have row 1 (the row with question text) to test 1 then row with students answers then row with questions to test 2 student answers to these tests...连接所有这些操作中的行,所以我将有第 1 行(带有问题文本的行)来测试 1,然后用学生的答案行,然后用问题来测试 2 个学生对这些测试的答案......

I would really appreciate the help (oh and I rather look for achieving it through google sheets formula not by app script function - because import range is so much more efficient than using sheet service in-app script)我真的很感激你的帮助(哦,我宁愿通过谷歌表格公式而不是应用程序脚本函数来实现它 - 因为导入范围比使用应用程序内的表格服务脚本更有效)

I created test cases in order to help with the resolution of the problem a summary spreadsheet where I want to accumulate data:我创建了测试用例以帮助解决问题,我想在一个摘要电子表格中积累数据:

https://docs.google.com/spreadsheets/d/1cJn8CX25t98GI9E4aYgsQPNt28w_sX0ynfhwkG3ZKyA/edit?usp=sharing https://docs.google.com/spreadsheets/d/1cJn8CX25t98GI9E4aYgsQPNt28w_sX0ynfhwkG3ZKyA/edit?usp=sharing

spreadsheets that mimics data imported from forms:模仿从表单导入的数据的电子表格:

https://docs.google.com/spreadsheets/d/1BgYN7f6ojk7NhOlj2FuSm0goMt_HjqkebWiOJYQmN0E/edit?usp=sharing https://docs.google.com/spreadsheets/d/1BgYN7f6ojk7NhOlj2FuSm0goMt_HjqkebWiOJYQmN0E/edit?usp=sharing

https://docs.google.com/spreadsheets/d/19cDQR-tN5_S_rblc-hbavxVF0xforoMaKUQYjuYBN-E/edit?usp=sharing https://docs.google.com/spreadsheets/d/19cDQR-tN5_S_rblc-hbavxVF0xforoMaKUQYjuYBN-E/edit?usp=sharing

https://docs.google.com/spreadsheets/d/1QPMcHIH5PXQwWbAULk7vxJ4g-pSXK1qHKhFvLwdRaAU/edit?usp=sharing https://docs.google.com/spreadsheets/d/1QPMcHIH5PXQwWbAULk7vxJ4g-pSXK1qHKhFvLwdRaAU/edit?usp=sharing

try:尝试:

={""; ARRAYFORMULA("=QUERY({"&TEXTJOIN(";", 1, "IMPORTRANGE("""&
 TRANSPOSE(SPLIT(B2, ","))&""", ""'Sheet1'!A1:Z1000"")")&
 "}, ""where Col1 is not null"", 0)")}

0

then copy generated formula and paste it where you need:然后复制生成的公式并将其粘贴到您需要的位置:

0


UPDATE:更新:

={""; ARRAYFORMULA("=FILTER(QUERY({"&TEXTJOIN(";", 1, "IMPORTRANGE("""&
 TRANSPOSE(SPLIT(B2, ","))&""", ""'Sheet1'!A1:Z1000"")")&
 "}, ""where Col1 is not null"", 0), REGEXMATCH(TRANSPOSE(QUERY(TRANSPOSE(QUERY({"&
 TEXTJOIN(";", 1, "IMPORTRANGE("""&
 TRANSPOSE(SPLIT(B2, ","))&""", ""'Sheet1'!A1:Z1000"")")&
 "}, ""where Col1 is not null"", 0)),,99^99)), A2))")}

0

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

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