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

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

相关推荐
一行注释12 小时前
纯前端通过xlsx.js导出Excel表格:完整示例与实战指南
前端·javascript·excel
QuartusII713 小时前
Excel中alt+enter单元格内无法换行
excel
Arya_aa13 小时前
EasyExcel读和写
excel
冷咖啡离 我的笨笨13 小时前
数据去重:通过 C# 删除 Excel 中的重复行
开发语言·c#·excel
Marhoosh17 小时前
Excel跨表匹配工具|多表批量查找、提取与汇总
excel·excel技巧·跨表匹配
TechWJ17 小时前
Excel报表越做越乱?用Metabase搭建可更新的数据仪表盘
docker·数据分析·excel·metabase·报表工具
用户2986985301419 小时前
无需安装 Excel,也能轻松将 CSV 转为 XLS 或 XLSX
后端·c#·excel
ms365copilot1 天前
算数据+做图表,Copilot Excel公式+图表联动
excel·copilot
ms365copilot2 天前
在Copilot聊天中添加Word、Excel 和 PowerPoint 代理
word·excel·copilot
Smilecoc2 天前
Excel之Subtotal:功能强大的统计函数
excel