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

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

相关推荐
Cloud_Shy6188 小时前
Python 数据分析基础入门:《Excel Python:飞速搞定数据分析与处理》学习笔记系列(第十二章 用户定义函数 上篇)
python·数据分析·excel·pandas
QuZhengRong9 小时前
【Luck-Report】缓存
java·前端·后端·vue·excel
程序员老油条11 小时前
Excel合并的单元格拆分并批量填充为已有数据
excel
QQ129584550412 小时前
FERP50 - Excel以存储过程方式访问数据仓库
数据仓库·spark·excel
Omics Pro12 小时前
免费!糖蛋白质组学数据分析
开发语言·深度学习·数据挖掘·数据分析·r语言·excel·知识图谱
开始脱发的自然卷12 小时前
用 Excel 手算一个 1-6-1 MLP:前向传播、损失、反向传播与参数更新
excel
阿波罗尼亚13 小时前
浮点数精度问题
java·excel
程序员敲代码吗1 天前
Go语言中Channel的实现与内存通信机制详解
excel
时空自由民.1 天前
vim入门配置教程
编辑器·vim·excel
_院长大人_1 天前
Java Excel导出:如何实现自定义表头与字段顺序的完全控制
java·开发语言·后端·excel