创建长格式摘要

问题描述 投票:0回答:1

如何使用 Google 表格中的公式将宽表转换为长格式?在每个组中,值应按字母顺序排序(例如,anna 在预期输出中排在第一位)。应忽略空白单元格。

enter image description here

预期输出是以长格式汇总的数据:

enter image description here

google-sheets google-sheets-formula
1个回答
0
投票

特定列中的元素是否与列标签具有相同的内容?如果没有,这里有一个可行的方法,尽管它有点草率。

=LET(z,TOCOL(,1),range,A1:D5,query(arrayformula(split(tocol(bycol(range,lambda(k,REDUCE(z,k,LAMBDA(a,c,vstack(a,if(c=index(k,1,1),z,if(c<>"",index(k,1,1)&"|"&c,z))))))),3,1),"|")),"select Col1,Col2 order by Col2 asc"))
© www.soinside.com 2019 - 2024. All rights reserved.