跳到主要内容

如何在Excel中用逗号,空格,换行符连接范围/单元格?

本文讨论的是通过逗号或空格将行/列连接到一个单元格中,以及通过任何类型的分隔符(例如,逗号,空格,在Excel中换行等。


按公式用逗号/空格连接一行

例如,您有一排名称,如下面的屏幕快照所示,您需要将该行连接到一个单元格中,并用逗号或空格分隔单元格内容。 您可以按以下方式应用CONCATENATE函数:
doc用逗号空格换行连接范围0

1.选择一个空白单元格,将其放入串联结果中,然后输入公式 = CONCATENATE(B1:J1&“,”) 进去。

2.高亮显示 B1:J1&“,” 在公式中并按 F9 用单元格内容替换单元格引用的键。

3.取下花括号 {} 从公式中,然后按 输入 键。 看截图:
doc用逗号空格换行连接范围1

备注:在上面的公式中,B1:J1是要连接的行,“,”表示您将用逗号分隔每个单元格内容。 为了以空格分隔,请在公式中将“,”替换为“”。

批量合并多个单元格/行/列,而不会丢失Excel中的数据和日期/数字格式

通常,当使用 Excel 中的合并功能合并单元格时,它会删除除第一个单元格内容之外的所有单元格内容。但是,使用 Kutools for Excel 的 合并(行和列)实用程序,您可以轻松地批量合并多个单元格/行/列,而不会丢失数据。 此外,该实用程序还支持组合结果中其余的原始日期格式和数字格式。


广告组合行列保持格式

按公式用逗号/空格连接一列

假设您有一列名称,如下面的屏幕快照所示,您还可以应用CONCATENATE函数将该列/列表组合到一个单元格中,并在Excel中用逗号或空格分隔每个单元格内容。

doc用逗号空格换行连接范围3

1.选择一个空白单元格,将其放入串联结果中,然后输入公式 = CONCATENATE(TRANSPOSE(A2:A16)&“,”) 进去。

2.高亮显示 TRANSPOSE(A2:A16)&“,” 在公式中,然后按 F9 用单元格内容替换单元格引用的键。

3.去除花括号 {} 从公式中,然后按 输入 键。 见上面的截图:

备注:在上面的公式中,A2:A16是要连接的列/列表,并且 “,” 表示您将用逗号分隔每个单元格内容。 为了空间分隔,请更换 “,” “” 在公式。


通过 Kutools for Excel 连接范围/行/列与逗号/空格/换行符

例如,您有一个如下图所示的范围,您可以使用 Kutools for Excel 轻松将此范围连接成一列、一行或一个单元格 结合 效用。

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!

1.选择要连接的范围,然后单击 库工具 > 合并和拆分>合并行,列或单元格而不会丢失数据。 看截图:
doc合并行列单元格

2.在打开的对话框中,请执行以下操作:
doc用逗号空格换行连接范围5
(1)在 根据以下选项合并选定的单元格 部分,根据需要指定组合选项。 在我们的情况下,我们检查 合并栏 选项;
(2)在 指定分隔符 部分,根据需要检查分隔符。 在我们的情况下,我们检查 新队 选项;
(3)从 将结果放置到 下拉列表。 在我们的情况下,我们选择 左细胞.
(4)在 附加选项 部分,请检查 删除合并单元格的内容 选项。 看截图:

Kutools for Excel - 使用 300 多种基本工具增强 Excel 功能。 享受全功能 30 天免费试用,无需信用卡! 立即行动吧!

3。 点击 Ok 按钮。

然后,您将看到选定的列合并为一列,并且每行中的单元格被串联到该行的第一个单元格中。 看截图:
doc用逗号空格换行连接范围6

选择 合并行 在选项 根据以下选项合并选定的单元格 部分:
doc用逗号空格换行连接范围7

根据以下选项合并选定的单元格 部分:
doc用逗号空格换行连接范围9


演示:在Excel中用逗号,空格,换行符连接范围/单元格


Kutools for Excel:超过 300 个方便的工具触手可及! 立即开始 30 天免费试用,没有任何功能限制。 立即下载!

相关文章:

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
...happens when 'Remove curly braces { and } from the formula'. I also getting feedback from Excel there's a limit of number of number of cells, I'm doing 1,289.
This comment was minimized by the moderator on the site
Hi there,

Yes, 1,289 items are too much for CONCATENATE.
Are you using Excel 2019 or a newer versions? If so, please use Excel's TEXTJOIN function, for example, =TEXTJOIN(", ",TRUE,A1:F1000). Please click here to see the details of the function: https://www.extendoffice.com/excel/functions/excel-textjoin-function.html
If not, you can use Kutools for Excel by following the third method in this page: Concatenate a range/row/column with comma/space/line break

Amanda
This comment was minimized by the moderator on the site
I get an error for this formula, Excel doesn't recognize it's a formula, throws up a pop-up to add an (') before the = sign??

1. Select a blank cell you will place the concatenation result in, and enter the formula =CONCATENATE(TRANSPOSE(A2:A16)&",") into it.

2. Highlight the TRANSPOSE(A2:A16)&"," in the formula, and press the F9 key to replace cell reference with cell contents.

3. Remove curly braces { and } from the formula, and press the Enter key.
This comment was minimized by the moderator on the site
Super, and this is very easy shortcut for concatenation.. Concate(A2:A10&","). thankyou
This comment was minimized by the moderator on the site
Is there any way of removing the last comma?
This comment was minimized by the moderator on the site
Hi there,

Is the last comma the last character of a string? For example: "a, b, c, d,". If so, you can use the formula: =IF(RIGHT(A1,1)=",",LEFT(A1,LEN(A1)-1),A1) from the tutorial: https://www.extendoffice.com/documents/excel/2102-excel-remove-last-comma.html
Note: Please change A1 to the actual cell reference of your case.

Amanda
This comment was minimized by the moderator on the site
This didnt help at all thanks for wasting my time and energy on this.
This comment was minimized by the moderator on the site
I tried the methods, they worked perfect for me. Did you follow the exactl steps for your data?
This comment was minimized by the moderator on the site
Exactly what I was looking for - THANK YOU!!
This comment was minimized by the moderator on the site
Thanks a lot . This post is very helpful to reduce a lot of time in our day to day tasks.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations