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

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

相关推荐
2501_9307077821 小时前
使用C#代码将 Excel 转换为 ODS,或将 ODS 转换为 Excel
excel
缺点内向21 小时前
如何在 C# .NET 中将 Markdown 转换为 PDF 和 Excel:完整指南
pdf·c#·.net·excel
m5655bj21 小时前
如何通过 Python 在 Excel 中添加或删除图片
python·excel
伍一5121 小时前
芋道框架下的进销存升级(三):Yudao-ERP2异步导出/导入Excel的设计与实现
java·excel·异步导出excel
CodeCraft Studio21 小时前
Excel处理控件Aspose.Cells教程:使用C#在Excel中创建旭日图
c#·excel·aspose·excel旭日图·excel库·excel开发控件·excel api库
过期的秋刀鱼!1 天前
Excel-数据分析开发心得(工具PQ,PP)与开发经验
大数据·数据分析·excel·模型搭建·数据优化·powerquery·powerpivot
凯子坚持 c1 天前
CodeRider-Kilo 驱动下的 Python Excel 自动化开发全流程深度解析
python·自动化·excel
啊哈哈哈哈啊有2 天前
导出树形结构,excel
java·windows·excel
Dxy12393102162 天前
Elasticsearch 聚合入门:像 Excel 透视表一样分析数据
elasticsearch·excel
一位代码2 天前
Excel | .xls 与 .xlsx 文件的区别及使用 Excel 打开 CSV 文件出现乱码的解决办法
excel