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

表格的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读取Excel/CSV到MySQL
python·mysql·excel
jiayong232 小时前
Excel核心功能快速入门指南
excel
WarPigs1 天前
Excel WPS表格笔记
excel·wps
fengyehongWorld1 天前
Excel 切片器 快速过滤数据
excel
骆驼爱记录1 天前
Word兼容性问题全解析
自动化·word·excel·wps·新人首发
funnycoffee1232 天前
EXCEL VBA Color 将选中区域 的指定字符,设置字体颜色(比如红)
excel·excel vba·vba字体颜色
m5655bj2 天前
通过 Python 删除 Excel 中的空白行列
python·ui·excel
2501_944934732 天前
大专信息统计与分析专业,怎么提升Excel高级函数的使用能力?
大数据·excel
优选资源分享2 天前
ASAP Utilities V9.2:Excel 办公效率插件 中文版
excel
技小宝2 天前
如何在WPS/Excel中批量翻译长文本?
经验分享·职场和发展·excel·wps