如何转变:
Color Number Fuit
Yellow
1
Banana
Red
2
Apple
Green
3
Grape
...变成这样:
Color Number Fuit
Yellow 1 Banana
Red 2 Apple
Green 3 Grape
我最好的尝试是使用 =split(C22,char(10)&","),但它只是将每一行拆分成一个新列。它们应该拆分成新列,直到一定次数,在本例中是 3 次。然后跳转到下面的行。依此类推。
答案1
您可以使用类似以下内容:
=ARRAYFORMULA(TRIM(SPLIT(TRANSPOSE(SPLIT(REGEXREPLACE(TEXTJOIN(",",TRUE,A2:A),"(([\w\s\S]+?,){3})","$1@"),"@")),",")))
正如这个答案中详细说明的那样https://stackoverflow.com/a/65624161/5518385
另一种类似的方法是:
=ArrayFormula(TRIM(split(transpose(SPLIT(Query(A2:A10&","&if(MOD(row(A2:A10)-row(A1),3)=0,"|",""),,9^9),"|")),",")))
如本文所述https://infoinspired.com/google-docs/spreadsheet/split-a-column-into-multiple-n-columns-sheets/