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

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

相关推荐
大佬,救命!!!14 小时前
etp中未运行用例顺序的定位及补齐脚本自动化生成
python·学习笔记·excel·自动化脚本·用例整理清洗
专职14 小时前
cursor中与vim插件冲突时的配置
编辑器·vim·excel
木易:_/17 小时前
【001】EXCEL办公技巧:隔行提取_excel
excel
木易:_/17 小时前
【002】EXCEL办公技巧:替换文本“=”快速提取_excel
excel
Java面试题总结17 小时前
Python 入门(四)- Openpyxl 操作 Excel 教程
开发语言·python·excel
chatexcel18 小时前
ChatExcel AI工具测试报告:从 AI Excel、数据分析到 AI PPT 的完整闭环
人工智能·数据分析·excel
babe小鑫19 小时前
想学Excel函数,学数据分析的价值分析
数据挖掘·数据分析·excel
闲云一鹤1 天前
Python 入门(四)- Openpyxl 操作 Excel 教程
python·excel
城数派2 天前
2025年我国乡镇的平均高程数据(Excel\Shp格式)
数据库·arcgis·信息可视化·数据分析·excel
葡萄城技术团队2 天前
Excel 中 VSTACK 与 HSTACK 函数:纵向与横向合并数据的实用指南
excel