将格内多行文字展开成多格

表格的A列是分类,B列由多行文字组成,即分隔符是换行符。

|---|----------------|-------------------------------------------------------------------------------------------------------------------------|
| | A | B |
| 1 | Account Number | Interaction |
| 2 | 1 | Jan 1,2023 - Hello. |
| 3 | 2 | Jan 2, 2023 - Good morning. Jan 3, 2023 - Good night. Jan 4, 20 Jan 5, 2023 - Good night. Jan 6, 2023 - Good afternoon. |
| 4 | 3 | Jan 1,2023 - Good night. Jan 2, 2023 - Good afternoon. |

请将B列的每格展开成多个单元格,并复制A列

|---|----------------|-------------------------------|
| | A | B |
| 1 | Account Number | Interaction |
| 2 | 1 | Jan 1,2023 - Hello. |
| 3 | 2 | Jan 2, 2023 - Good morning. |
| 4 | 2 | Jan 3, 2023 - Good night. |
| 5 | 2 | Jan 4, 20 |
| 6 | 2 | Jan 5, 2023 - Good night. |
| 7 | 2 | Jan 6, 2023 - Good afternoon. |
| 8 | 3 | Jan 1,2023 - Good night. |
| 9 | 3 | Jan 2, 2023 - Good afternoon. |

使用 SPL XLL

复制代码
=spl("=?.news@q(~2.import@si();[get(1)(1),~])",A2:B4)

函数 news@q 用序列的成员生成新序列,~2 是当前变量的第 2 个成员,import@si将字符串按回车解析成单行字符串组成的序列,get 在多层循环中按层数返回循环变量。

相关推荐
清晨细雨~34 分钟前
SpringBoot整合EasyExcel实现Excel表头校验
spring boot·后端·excel
进阶的猿猴8 小时前
easyExcel实现单元格合并
java·excel
黄色茶杯9 小时前
解决WPS的word文件嵌入EXCEL无法双击打开
word·excel·wps
YDS82921 小时前
苍穹外卖 —— 数据统计和使用Apache_POI库导出Excel报表
java·spring boot·后端·excel
办公解码器1 天前
Excel工作表打开一次后自动销毁文件,回收站中都找不到
数据库·excel
mudtools1 天前
.NET驾驭Excel之力:工作簿与工作表操作基础
c#·.net·excel
mudtools1 天前
.NET驾驭Excel之力:单元格与区域操作详解
c#·.net·excel
秋天之落叶1 天前
使用ADO将excel表内容加载到mssql表中的长度问题
数据库·sqlserver·excel
1314lay_10071 天前
SAP ABAP 导入excel表,导多个sheet
excel·abap
玩泥巴的1 天前
.NET驾驭Excel之力:工作簿与工作表操作基础
c#·excel·二次开发·office·com互操作