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

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

相关推荐
ohoy1 小时前
easypoi 自定义样式 学生-分数红绿颜色设置
excel
ranchor6662 小时前
excel+pandas使用str.contains() 的典型例子
excel·pandas
Neoest2 小时前
【Java 填坑日记】Excel里的“1.00“存入数据库解密后,Integer说它不认识:一次 NumberFormatException 翻车实录
java·数据库·excel
lzq6032 小时前
Python自动化办公:5分钟批量处理Excel数据
python·自动化·excel
oh,huoyuyan2 小时前
【实战案例】使用火语言RPA『表格数据提取』组件,批量爬取蔬菜价格+Excel 整理
爬虫·excel·rpa
缺点内向2 小时前
如何在Excel文档中获取分页信息
后端·c#·.net·excel
黑客思维者2 小时前
Python自动化办公全攻略:Excel/Word/PDF/邮件批量处理
python·自动化·excel
caleb_52018 小时前
Excel导出问题:accessExternalStylesheet
excel
YANshangqian19 小时前
图片转Excel表格
excel
梦幻通灵1 天前
Excel快速比较两列的异同实战方案
excel