Google Sheets - Concatenating Multiple lists across sheets

落花浮王杯 提交于 2020-05-16 02:32:13

问题


I am interested in taking the values from 1 list in a sheet and concatenating it with the values from another list in a different sheet in Google Sheets. For example, if my lists are:

Sheet A

  • Apple
  • Orange

Sheet B

  • Quarter
  • Half
  • Whole

I would want to generate on Sheet C this...

  • Apple Quarter
  • Apple Half
  • Apple Whole
  • Orange Quarter
  • Orange Half
  • Orange Whole

Is this possible? I tried doing this with ARRAYFORMULA, but I just end up outputting something like this: Apple QuarterHalfWhole


回答1:


Here you go:

=ARRAYFORMULA(FLATTEN(A1:A2 & " " & TRANSPOSE(B1:B3)))
  • A1:A2 and B1:B3 indeed could be from a different sheet (tab or document (IMPORTRANGE will be used for that case))
  • FLATTEN is undocumented function in Google Sheets, which will make a 2D-range into a column. I learned about it recently from @MattKing here on SO.



来源:https://stackoverflow.com/questions/61566668/google-sheets-concatenating-multiple-lists-across-sheets

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!