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

表格的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 小时前
Word题注编号间距调整4种方法
自动化·word·excel·wps·新人首发
Eiceblue5 小时前
两种实用方法删除 Excel 重复行:Python + VBA
开发语言·python·excel
m5655bj21 小时前
通过 Python 将 Excel 转换为 TXT文本
开发语言·python·excel
要做一个小太阳1 天前
excel VLOOKUP函数
excel
博风1 天前
用excel写一个年会抽奖的小程序
excel
零零发聊技术1 天前
Excel实现数字与列标之间的转换
excel·vba·office
老吴学AI1 天前
第 3 节 | 视觉魔术:Excel 如何用颜色和位置“控制”读者视线
信息可视化·数据分析·excel·职场·数据可视化·报表制作·用数据讲故事
零零发聊技术1 天前
将电脑Excel文件恢复到几天前的版本
文件恢复·excel
罗政2 天前
一键对多个Excel文件进行差异内容提取分析+显示差值
excel
罗政2 天前
AI提取一批Excel单元格内容(快递信息)数据安全,支持断网提取
人工智能·excel