如何删除多行并将其合并为特定单元格中的一行。

huangapple go评论51阅读模式
英文:

How to remove multiple lines and make it a single line in particular cell

问题

有1000多行在我的Excel中,我想格式化这些行,以便删除多行并将它们合并成一个单行放在特定的单元格中。请帮助

PS:当我点击"合并和居中"选项时,我可以实现一行的效果,但如果我用于整个工作表,它无法正常工作。

目前显示如下:

如何删除多行并将其合并为特定单元格中的一行。

期望效果:

如何删除多行并将其合并为特定单元格中的一行。

英文:

There are more than 1000's of rows in my excel and I want to format the lines such that I need to remove multiple lines and make it a single line in particular cell. Please help

PS: When I click on Merge and Center option, I can achieve for one row, But if I use it for entire sheet, doesn't work out.

Currently it appears as below:

如何删除多行并将其合并为特定单元格中的一行。

Expected :

如何删除多行并将其合并为特定单元格中的一行。

答案1

得分: 1

以下是翻译好的内容:

以下代码应该有效,假设唯一键是AdapterDate的组合,如果不是,那么可以进行调整。

这里是输出结果:
如何删除多行并将其合并为特定单元格中的一行。

单元格内的新行存在,但我不知道为什么我的Excel没有可视化。根据这个链接,它应该是可见的。它之所以存在,是因为如果我执行TEXTSPLIT(G2, CHAR(10)),它会被拆分。

英文:

The following should work, assuming the unique key is the combination of Adapter and Date, if not then it can be adjusted.

=LET(AB,A2:B6, A,TAKE(AB,,1), B,DROP(AB,,1), C,C2:C6, ux,UNIQUE(AB),
 uxA,TAKE(ux,,1), uxB,DROP(ux,,1), out, MAP(uxA,uxB, 
 LAMBDA(x,y,TEXTJOIN(CHAR(10),,FILTER(C,(A=x)*(B=y))))),HSTACK(ux,out))

Here is the output:
如何删除多行并将其合并为特定单元格中的一行。

The new line inside the cell is there, but I don't know why my Excel doesn't get visualized. It should be, as per this link. It is there because if I do TEXTSPLIT(G2, CHAR(10)) it gets split.

huangapple
  • 本文由 发表于 2023年4月1日 01:12:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/75901090.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定