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

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

相关推荐
得闲喝茶7 小时前
SQL处理数据的常用语法语句
数据库·笔记·sql·数据分析·excel
hmywillstronger7 小时前
【Python】从SAP2000 XML截面库提取数据到Excel
xml·python·excel
抹茶咖啡7 小时前
IT运维的365天--045 WPS突然就不能正常打开Excel文件了
excel·it运维·wps
专注VB编程开发20年7 小时前
在 Python 中使用 comtypes 时,大小写通常必须保持精确
python·excel
E_ICEBLUE1 天前
如何提取 Word 文档中的表格并导出为 Excel(Python 教程)
python·word·excel
2501_930707781 天前
使用C#代码在 Excel 中创建雷达图
信息可视化·excel
fengyehongWorld1 天前
Excel Excel2024版本之后,行与列相关的函数
excel
小贺儿开发1 天前
Unity3D 年会抽奖工具(附体验链接)
数据库·unity·excel·人机交互·工具·抽奖·互动
Eiceblue1 天前
锁定单元格 :C# 控制 Excel 单元格编辑权限
开发语言·c#·excel