在 Google 表格中加入条件转置
Posted
技术标签:
【中文标题】在 Google 表格中加入条件转置【英文标题】:Conditional Transpose with join in Google Sheets 【发布时间】:2019-09-01 12:13:35 【问题描述】:我想在第一张表(仪表板)中从我的第二张表(StockList)创建一个基于作者的自动书单,如下面的链接:
https://docs.google.com/spreadsheets/d/16OOzurqBchn5sx5BCUzqVDvU9fA524aK9B5lGezjTUE/edit?usp=sharing
-> 如果一个作者有多本书,用逗号创建一个列列表(例如:Dashboard!B3)。
-> 如果有共同作者,则还创建了书名
问候
【问题讨论】:
【参考方案1】:粘贴到B2单元格:
=ARRAYFORMULA(IFERROR(VLOOKUP(A3:A,
SORT(UNIQUE(TRIM(TRANSPOSE(SPLIT(CONCATENATE(
IF(IFERROR(SPLIT(StockList!C2:C, ","))<>"", "♠"&SPLIT(StockList!C2:C, ","), )),"♠"))))),
REGEXREPLACE(TRIM(TRANSPOSE(QUERY(QUERY(QUERY(TRIM(SPLIT(TRANSPOSE(SPLIT(CONCATENATE(
IF(IFERROR(SPLIT(StockList!C2:C, ","))<>"",
"♦"&StockList!B2:B&","&"♠"&SPLIT(StockList!C2:C, ","), )), "♦")), "♠")),
"select max(Col1) where Col1 is not null group by Col1 pivot Col2", 0),
"offset 1", 0),, 999^99))), ",$", ), 2, 0)))
自定义孟加拉语修复:
=ARRAYFORMULA(QUERY(TRANSPOSE(QUERY(TRIM(SPLIT(TRANSPOSE(SPLIT(CONCATENATE(
IF(IFERROR(SPLIT(A!C3:C, ","))<>"", "♦"&A!B3:B&"♠"&SPLIT(A!C3:C, ","), )), "♦")), "♠")),
"select max(Col1) where Col1 is not null group by Col1 pivot Col2", 0)), "select Col1", 0),
QUERY(QUERY(TRIM(SPLIT(TRANSPOSE(SPLIT(CONCATENATE(
IF(IFERROR(SPLIT(A!C3:C, ","))<>"", "♦"&A!B3:B&"♠"&SPLIT(A!C3:C, ","), )), "♦")), "♠")),
"select count(Col2) where Col2 is not null group by Col2", 0), "offset 1", 0),
REGEXREPLACE(TRIM(TRANSPOSE(QUERY(QUERY(QUERY(TRIM(SPLIT(TRANSPOSE(SPLIT(CONCATENATE(
IF(IFERROR(SPLIT(A!C3:C, ","))<>"", "♦"&A!B3:B&",♠"&SPLIT(A!C3:C, ","), )), "♦")), "♠")),
"select max(Col1) where Col1 is not null group by Col1 pivot Col2", 0), "offset 1", 0)
,,999^99))), ",$", ))
【讨论】:
嗨,这很好,但是当我将您的代码复制粘贴到以我的本地语言(孟加拉语)创建的原始数据中时,出现了一点问题。 #!I11:I22 中的值是错误的。准确值为 G12=I22 和 I11:I21=G12:G22。提前感谢docs.google.com/spreadsheets/d/… docs.google.com/spreadsheets/d/… 检查工作表中的 K:L 列是否正常或仍然不合适 和以前一样。准确值为 K11=L22 & K12: K22=L11:L21 非常感谢以上是关于在 Google 表格中加入条件转置的主要内容,如果未能解决你的问题,请参考以下文章
怎么在JTable表格中加入如JComboBox之类的控件?有注释加分。