Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google sheets 在GoogleSheets中,如何根据在不同列中拆分字符串的结果聚合值(最大值、最小值、平均值)?_Google Sheets_Google Sheets Formula_Transpose_Array Formulas_Google Sheets Query - Fatal编程技术网

Google sheets 在GoogleSheets中,如何根据在不同列中拆分字符串的结果聚合值(最大值、最小值、平均值)?

Google sheets 在GoogleSheets中,如何根据在不同列中拆分字符串的结果聚合值(最大值、最小值、平均值)?,google-sheets,google-sheets-formula,transpose,array-formulas,google-sheets-query,Google Sheets,Google Sheets Formula,Transpose,Array Formulas,Google Sheets Query,如果我有一个具有以下值的表,如何生成下表?结果表分离出每个标记,并计算所提及标记的行数(计数)以及给定标记的最大值 +-----+-------------+ | VAL | TAGS | +-----+-------------+ | 4 | html, css | +-----+-------------+ | 2 | js, ts | +-----+-------------+ | 3

如果我有一个具有以下值的表,如何生成下表?结果表分离出每个标记,并计算所提及标记的行数(计数)以及给定标记的最大值

    +-----+-------------+
    | VAL | TAGS        |
    +-----+-------------+
    |  4  | html, css   | 
    +-----+-------------+
    |  2  | js, ts      |
    +-----+-------------+
    |  3  | js, css     |
    +-----+-------------+
尝试:

【代码】=ARRAYFORMULA(查询)(拆分)(转置)(拆分)(转置)(查询)(转置( 如果(Iferor(拆分)(B3:B,“,”)“,”♀"&A3:A&“♦“&拆分( 替换(B3:B,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,)♦", )),,999^99)),,999^99), "♀")), "♦"), 选择列2、计数(列1)、平均值(列1)、最大值(列1)、最小值(列1) Col2分组 标签Col2'tags')

使用如下公式:

=query (
   arrayformula (
      split (
         transpose (
            split (
               textjoin (
                     ",",true, 
                     arrayformula (
                         {filter(A90:A,A90:A<>"") & "✫" & 
                          trim(split(filter(B90:B,A90:A<>""),","))
                         }
                     )
               ),",")
            ),"✫"
         )
      ), 
   "select Col2, count(Col2), max(Col1) where Col2 is not null group by Col2  label Col2 'Tag'")
=查询(
阵列公式(
分裂(
转置(
分裂(
文本连接(
","对,,
阵列公式(
{过滤器(A90:A,A90:A“”)&“✫" & 
阀内件(分离式(过滤器(B90:B,A90:A“”),“,”)
}
)
),",")
),"✫"
)
), 
“选择Col2,count(Col2),max(Col1),其中Col2不为null按Col2标签Col2'Tag'分组”

哇,这是一个粗糙的公式!但它看起来很有效。实际上,我最终实现了一个使用自定义公式的解决方案。你认为你的解决方案会更快还是更慢?取决于…如此小的样本并不重要-从速度上看,它会是相同的。这只是我为这个问题创建的一个样本,真实的数据集有hund一排排的红色。
=ARRAYFORMULA(QUERY(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
 IF(IFERROR(SPLIT(B3:B, ","))<>"", "♀"&A3:A&"♦"&SPLIT(
 SUBSTITUTE(B3:B, ", ", ","), ",")&"♦", )),,999^99)),,999^99), "♀")), "♦"), 
 "select Col2,count(Col1),avg(Col1),max(Col1),min(Col1) 
  group by Col2
  label Col2'tags'"))
=query (
   arrayformula (
      split (
         transpose (
            split (
               textjoin (
                     ",",true, 
                     arrayformula (
                         {filter(A90:A,A90:A<>"") & "✫" & 
                          trim(split(filter(B90:B,A90:A<>""),","))
                         }
                     )
               ),",")
            ),"✫"
         )
      ), 
   "select Col2, count(Col2), max(Col1) where Col2 is not null group by Col2  label Col2 'Tag'")