跳到主要內容

如何在Excel中以逗號,空格,換行符連接範圍/單元格?

本文討論的是將行/列連接到一個單元格中,並用逗號或空格分隔,以及將範圍連接到一個行/列/單元格中,並使用任何類型的分隔符(例如,逗號,空格,在Excel中換行等。


按公式用逗號/空格連接一行

例如,您有一排名稱,如下面的屏幕快照所示,您需要將該行連接到一個單元格中,並用逗號或空格分隔單元格內容。 您可以按以下方式應用CONCATENATE函數:
doc用逗號空格換行連接範圍0

1.選擇一個空白單元格,將其放入串聯結果中,然後輸入公式 = CONCATENATE(B1:J1&“,”) 進去。

2.高亮顯示 B1:J1&“,” 在公式中並按 F9 用單元格內容替換單元格引用的鍵。

3.取下花括號 {} 從公式中,然後按 Enter 鍵。 看截圖:
doc用逗號空格換行連接範圍1

備註:在上面的公式中,B1:J1是要連接的行,“,”表示您將用逗號分隔每個單元格內容。 為了以空格分隔,請在公式中將“,”替換為“”。

批量合併多個單元格/行/列,而不會丟失Excel中的數據和日期/數字格式

通常,使用Excel中的“合併”功能合併單元格時,它將刪除除第一個單元格內容以外的所有單元格內容。 但是,使用Kutools for Excel的 合併(行和列)實用程序,您可以輕鬆地批量合併多個單元格/行/列,而不會丟失數據。 而且,該實用程序還支持組合結果中其餘的原始日期格式和數字格式。


廣告組合行列保持格式

按公式用逗號/空格連接一列

假設您有一列名稱,如下面的屏幕快照所示,您還可以應用CONCATENATE函數將該列/列表組合到一個單元格中,並在Excel中用逗號或空格分隔每個單元格內容。

doc用逗號空格換行連接範圍3

1.選擇一個空白單元格,將其放入串聯結果中,然後輸入公式 = CONCATENATE(TRANSPOSE(A2:A16)&“,”) 進去。

2.高亮顯示 TRANSPOSE(A2:A16)&“,” 在公式中,然後按 F9 用單元格內容替換單元格引用的鍵。

3.去除花括號 {} 從公式中,然後按 Enter 鍵。 見上面的截圖:

備註:在上面的公式中,A2:A16是要連接的列/列表,並且 “,” 表示您將用逗號分隔每個單元格內容。 為了空間分隔,請更換 “,” with “” 在公式。


由Kutools for Excel將範圍/行/列與逗號/空格/換行符連接起來

例如,您有一個如下所示的屏幕截圖範圍,您可以使用Kutools for Excel輕鬆地將該範圍連接到一列,一行或一個單元格中 結合 效用。

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

1.選擇要連接的範圍,然後單擊 庫工具 > 合併和拆分>合併行,列或單元格而不會丟失數據。 看截圖:
doc合併行列單元格

2.在打開的對話框中,請執行以下操作:
doc用逗號空格換行連接範圍5
(1)在 根據以下選項合併選定的單元格 部分,根據需要指定組合選項。 在我們的情況下,我們檢查 合併欄 選項;
(2)在 指定分隔符 部分,根據需要檢查分隔符。 在我們的情況下,我們檢查 新隊 選項;
(3)從 將結果放置到 下拉列表。 在我們的情況下,我們選擇 左細胞.
(4)在 選項 部分,請檢查 刪除合併單元格的內容 選項。 看截圖:

Excel的Kutools - 使用 300 多種基本工具增強 Excel 功能。 享受全功能 30 天免費試用,無需信用卡! 立即行動吧!

3。 點擊 Ok 按鈕。

然後,您將看到選定的列合併為一列,並且每行中的單元格被串聯到該行的第一個單元格中。 看截圖:
doc用逗號空格換行連接範圍6

選擇 合併行 在選項 根據以下選項合併選定的單元格 部分:
doc用逗號空格換行連接範圍7

根據以下選項合併選定的單元格 部分:
doc用逗號空格換行連接範圍9


演示:在Excel中用逗號,空格,換行符連接範圍/單元格


Excel的Kutools:超過 300 個方便的工具觸手可及! 立即開始 30 天免費試用,沒有任何功能限制。 現在就下載!

相關文章:

最佳辦公生產力工具

🤖 Kutools 人工智慧助手:基於以下內容徹底改變數據分析: 智慧執行   |  生成代碼  |  建立自訂公式  |  分析數據並產生圖表  |  呼叫 Kutools 函數...
熱門特色: 尋找、突出顯示或識別重複項   |  刪除空白行   |  合併列或儲存格而不遺失數據   |   沒有公式的回合 ...
超級查詢: 多條件VLookup    多值VLookup  |   跨多個工作表的 VLookup   |   模糊查詢 ....
高級下拉列表: 快速建立下拉列表   |  依賴下拉列表   |  多選下拉列表 ....
欄目經理: 新增特定數量的列  |  移動列  |  切換隱藏列的可見性狀態  |  比較範圍和列 ...
特色功能: 網格焦點   |  設計圖   |   大方程式酒吧    工作簿和工作表管理器   |  資源庫 (自動文字)   |  日期選擇器   |  合併工作表   |  加密/解密單元格    按清單發送電子郵件   |  超級濾鏡   |   特殊過濾器 (過濾粗體/斜體/刪除線...)...
前 15 個工具集12 文本 工具 (添加文本, 刪除字符,...)   |   50+ 圖表 類型 (甘特圖,...)   |   40+ 實用 公式 (根據生日計算年齡,...)   |   19 插入 工具 (插入二維碼, 從路徑插入圖片,...)   |   12 轉化 工具 (數字到單詞, 貨幣兌換,...)   |   7 合併與拆分 工具 (高級合併行, 分裂細胞,...)   |   ... 和更多

使用 Kutools for Excel 增強您的 Excel 技能,體驗前所未有的效率。 Kutools for Excel 提供了 300 多種進階功能來提高生產力並節省時間。  點擊此處獲取您最需要的功能...

產品描述


Office選項卡為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