如何保持少数列相同并将其余列数据转置为 Google 表格中的行?

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

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

参考这张表,我有一组复杂的数据,有 333 行,每行都有年份、品牌、型号,每行还有产品块,其数量可能有所不同,我希望年份、品牌、型号是这样的是,而不是列中的产品,而是行中的需求,这意味着而不是这个:

年份 制作 型号 蛞蝓1 蛞蝓2 蛞蝓3
2002 系列1 f82 a b c
2003 系列2 f83 a b c

我们会有

年份 制作 型号 蛞蝓
2002 系列1 f82 a
2002 系列1 f82 b
2002 系列1 f82 c
2003 系列2 f83 a
2003 系列2 f83 b
2003 系列2 f83 c

请帮忙

尝试过转置,尝试使用数组,但实际上对我来说有点太复杂了

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

您可以在单独的新选项卡中尝试此操作:

=reduce(tocol(,1),sequence(index(match(,0/('New prods - Sheet1.csv'!A2:A<>"")))),lambda(a,c,vstack(a,let(Λ,index(indirect("'New prods - Sheet1.csv'!D2:"&rows('New prods - Sheet1.csv'!A:A)),c),Σ,filter(Λ,Λ<>""),
 hstack(chooserows(index('New prods - Sheet1.csv'!A2:C,c),sequence(counta(Σ),1,1,0)),tocol(Σ,1))))))

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.