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

表格的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 小时前
vue导出excel文件
前端·vue.js·excel
CodeCraft Studio12 小时前
国产化Excel开发组件Spire.XLS教程:以Python编程方式在Excel中高亮重复值
开发语言·python·excel·spire.xls·excel自动化·excel高亮重复值·python处理excel
喝汽水的猫^1 天前
Java实现Excel 导出(多 Sheet、复杂格式)
java·excel
小费的部落1 天前
Excel 在Sheet3中 匹配Sheet1的A列和Sheet2的A列并处理空内容
java·前端·excel
缺点内向1 天前
如何在 C# 中重命名 Excel 工作表并设置标签颜色
开发语言·c#·excel
wtsolutions1 天前
Sheet-to-Doc: Automate Document Generation with Excel Data and Word Templates
word·excel·wtsolutions
wtsolutions1 天前
Sheet-to-Doc:用Excel数据和Word模板自动生成文档
excel·wps·wtsolutions
程序猿ZhangSir1 天前
将数据库数据导出为Excel文件,并针对性的对部分数据做脱敏加密,常用方法解析
excel
哆啦A梦15882 天前
商城后台管理系统 03 Vue项目-实现表格导出EXCEL表格
前端·vue.js·excel
xingzhemengyou12 天前
python pandas操作excel
python·excel·pandas