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

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

相关推荐
闲云一鹤2 小时前
Python 入门(四)- Openpyxl 操作 Excel 教程
python·excel
城数派9 小时前
2025年我国乡镇的平均高程数据(Excel\Shp格式)
数据库·arcgis·信息可视化·数据分析·excel
葡萄城技术团队10 小时前
Excel 中 VSTACK 与 HSTACK 函数:纵向与横向合并数据的实用指南
excel
hoiii18710 小时前
C# 读取 CSV/Excel 文件数据至 DataGridView
开发语言·c#·excel
herinspace1 天前
管家婆实用帖-如何使用ping命令检测网络环境
网络·数据库·人工智能·学习·excel·语音识别
hard_coding_wang1 天前
了解一个Excel批量替换的公式用法:REDUCE + LAMBDA 实现循环替换
开发语言·c#·excel
城数派1 天前
2025年省市县三级的平均高程数据(Excel\Shp格式)
数据库·arcgis·信息可视化·excel
weitingfu1 天前
Excel VBA 入门到精通(十):实战项目——自动化报表系统开发
ai·信息可视化·自动化·excel·vba·office·报表系统
鱼樱2 天前
腾讯版小龙虾WorkBuddy试用体验——Excel处理效率翻倍
excel
LucaJu2 天前
Java + EasyExcel 实现单个接口导出多个Excel
java·excel