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

表格的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 在多层循环中按层数返回循环变量。

相关推荐
蹦蹦跳跳垂耳兔1 天前
Excel中sumifs函数 #value报错
excel
m5655bj1 天前
使用 C# 实现 Excel 工作表拆分
windows·c#·excel·visual studio
weixin_462446231 天前
Python 使用 Tkinter + openpyxl 处理 Excel 文件并显示实时进度条
python·excel·tkinter
daols881 天前
vue 表格 vxe-table 手动操作单元格范围选择,手动选择 excel 指定区域的用法
vue.js·excel·vxe-table
开开心心_Every2 天前
多功能抽奖软件:游戏化互动体验
数据库·游戏·微信·pdf·excel·语音识别·ruby
开开心心就好2 天前
全屏程序切换工具,激活选中窗口快速切换
java·网络·windows·ci/cd·docker·电脑·excel
2501_930707782 天前
如何使用C#代码将图片插入到 Excel 中
开发语言·c#·excel
熊文豪2 天前
WPS Excel 内嵌图片的程序化导入导出技术
excel·poi·wps
开开心心_Every2 天前
提取PPT/Word/Excel图片工具
数据库·微信·pdf·word·powerpoint·excel·语音识别