* 从每 N 行找出需要数据拼成一行
Excel某表格不规范,每两行6列对应规范表格的一行3列,分别是:第1行第1列或第2行第1列(两者重复,取其一即可)、第2行第2列、第1行第3列。
A | B | C | |
1 | John Doe | Company A | |
2 | John Doe | john.doe@example.com | |
3 | Jane Smith | Company B | |
4 | Jane Smith | jane.smith@example.com | |
5 | Alice Lee | Company C | |
6 | Alice Lee | alice.lee@example.com | |
7 | Bob Johnson | Company D | |
8 | Bob Johnson | bob.johnson@example.com |
请拼出规范的表格。
E | F | G | |
1 | John Doe | john.doe@example.com | Company A |
2 | Jane Smith | jane.smith@example.com | Company B |
3 | Alice Lee | alice.lee@example.com | Company C |
4 | Bob Johnson | bob.johnson@example.com | Company D |
使用 SPL XLL
=spl("=?.group((#-1)\2).(~1(1)|~2(2)|~1(3))",A1:C8)
函数 group 按规则对表格分组,符号 #是行号,符号 \ 表示除法取整数部分,~1(1) 表示当前组的第 1 行第 1 列。
来源:https://www.reddit.com/r/excel/comments/1chvluy/how_can_i_combine_rows_in_excel/
跟着练一下:
英文版 https://c.scudata.com/article/1724652654546