Loncat ke daftar isi utama

Bagaimana cara mengubah daftar kolom menjadi daftar yang dipisahkan koma di Excel?

Jika Anda ingin mengonversi daftar kolom data menjadi daftar yang dipisahkan oleh koma atau pemisah lainnya, dan menampilkan hasilnya ke dalam sel seperti yang ditunjukkan di bawah ini, Anda bisa menyelesaikannya dengan fungsi CONCATENATE atau menjalankan VBA di Excel.


Ubah daftar kolom menjadi daftar yang dipisahkan koma dengan fungsi TEXTJOIN

Fungsi Excel TEXTJOIN menggabungkan beberapa nilai dari baris, kolom, atau rentang sel dengan pembatas tertentu.

Perhatikan bahwa fungsi ini hanya tersedia di Excel untuk Office 365, Excel 2021, dan Excel 2019.

Untuk mengonversi daftar kolom menjadi daftar yang dipisahkan koma, silakan pilih sel kosong, misalnya, sel C1, dan ketikkan rumus ini =TEXTJOIN(", ",TRUE,A1:A7) (A1: A7 adalah kolom yang akan Anda konversi ke daftar bergerigi koma, "" menunjukkan bagaimana Anda ingin memisahkan daftar). Lihat tangkapan layar di bawah ini:


Ubah daftar kolom menjadi daftar yang dipisahkan koma dengan fungsi CONCATENATE

Di Excel, fungsi CONCATENATE dapat mengubah daftar kolom menjadi daftar dalam sel yang dipisahkan dengan koma. Harap lakukan sebagai berikut:

1. Pilih sel kosong yang berdekatan dengan data pertama daftar, misalnya, sel C1, dan ketikkan rumus ini = CONCATENATE (TRANSPOSE (A1: A7) & ",") (A1: A7 adalah kolom yang akan Anda konversi ke daftar bergerigi koma, "," menunjukkan pemisah Anda ingin memisahkan daftar). Lihat tangkapan layar di bawah ini:

2. Sorot TRANSPOSE (A1: A7) & "," dalam rumus, dan tekan F9 kunci.

3. Hapus kawat gigi keriting {dan } dari rumus, dan tekan Enter kunci.

Sekarang, Anda dapat melihat semua nilai dalam daftar kolom telah diubah menjadi daftar dalam sel dan dipisahkan dengan koma. Lihat tangkapan layar di atas.

Ubah dengan cepat daftar kolom menjadi daftar yang dipisahkan koma dengan Kutools for Excel

Kutools untuk Excel Gabungkan Kolom atau Baris tanpa Kehilangan Data utilitas dapat membantu pengguna Excel dengan mudah menggabungkan beberapa kolom atau baris menjadi satu kolom / baris tanpa kehilangan data. Selain itu, pengguna Excel bisa membungkus string teks gabungan ini dengan carriage atau hard return.


Ubah daftar kolom menjadi daftar yang dipisahkan koma dengan VBA

Jika fungsi CONCATENATE agak membosankan untuk Anda, Anda dapat menggunakan VBA untuk dengan cepat mengonversi daftar kolom menjadi daftar dalam sel.

1. Memegang ALT tombol dan tekan F11 pada keyboard untuk membuka a Microsoft Visual Basic untuk Aplikasi jendela.

2. Klik Menyisipkan > Modul, dan salin VBA ke dalam modul.

VBA: Ubah daftar kolom menjadi daftar yang dipisahkan koma

Sub ChangeRange()
'Updateby20140310
Dim rng As Range
Dim InputRng As Range, OutRng As Range
xTitleId = "KutoolsforExcel"
Set InputRng = Application.Selection
Set InputRng = Application.InputBox("Range :", xTitleId, InputRng.Address, Type:=8)
Set OutRng = Application.InputBox("Out put to (single cell):", xTitleId, Type:=8)
outStr = ""
For Each rng In InputRng
    If outStr = "" Then
        outStr = rng.Value
    Else
        outStr = outStr & "," & rng.Value
    End If
Next
OutRng.Value = outStr
End Sub

3. Klik Run tombol atau tekan F5 untuk menjalankan VBA.

4. Sebuah dialog ditampilkan di layar, dan Anda dapat memilih daftar kolom yang ingin Anda ubah. Lihat tangkapan layar:

5. Klik OK, lalu dialog lain muncul untuk Anda memilih sel. Lihat tangkapan layar:

6. Klik OK, dan semua nilai dalam daftar kolom telah diubah menjadi daftar yang dipisahkan dengan koma dalam sel.

jenis: Dalam VBA di atas, "," menunjukkan pemisah yang Anda perlukan, dan Anda dapat mengubahnya sesuai kebutuhan.


Ubah daftar kolom menjadi daftar yang dipisahkan koma dengan Kutools for Excel

Anda juga bisa menerapkan Kutools for Excel's Menggabungkan utilitas untuk menggabungkan daftar kolom, dan memisahkan setiap nilai dengan koma dengan mudah.

Kutools untuk Excel - Tingkatkan Excel dengan lebih dari 300 alat penting. Nikmati uji coba GRATIS 30 hari berfitur lengkap tanpa memerlukan kartu kredit! Get It Now

1. Pilih daftar kolom yang akan Anda ubah menjadi daftar yang dipisahkan koma, dan klik Kutools > Gabungkan & Pisahkan> Gabungkan Baris, Kolom, atau Sel tanpa Kehilangan Data.

2. Di kotak dialog Gabungkan Kolom atau Baris pembuka, Anda perlu:
(1) Periksa Gabungkan baris pilihan dalam Untuk menggabungkan sel yang dipilih menurut opsi berikut bagian;
(2) Dalam Tentukan pemisah bagian, periksa Pemisah lainnya opsi, dan ketik koma , ke dalam kotak berikut;

3. klik Ok .

Sekarang Anda akan melihat semua nilai dalam daftar kolom yang ditentukan digabungkan menjadi satu sel dan diubah menjadi daftar yang dipisahkan koma.

Kutools untuk Excel - Tingkatkan Excel dengan lebih dari 300 alat penting. Nikmati uji coba GRATIS 30 hari berfitur lengkap tanpa memerlukan kartu kredit! Get It Now


Demo: ubah daftar kolom menjadi daftar yang dipisahkan koma di Excel


Kutools untuk Excel: Lebih dari 300 alat praktis di ujung jari Anda! Mulai uji coba gratis 30 hari Anda tanpa batasan fitur hari ini. Download Sekarang!

Membalikkan gabungan dan mengonversi satu sel (daftar bergerigi koma) ke daftar baris/kolom di Excel

Biasanya pengguna Excel dapat menerapkan Teks ke Kolom fitur untuk memisahkan satu sel menjadi beberapa kolom, tetapi tidak ada metode langsung untuk mengonversi satu sel menjadi beberapa baris. Namun, Kutools for Excel's Pisahkan Sel Utilitas dapat membantu Anda menyelesaikannya dengan mudah seperti gambar di bawah ini.



Artikel Relatif:

Comments (34)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This comment was minimized by the moderator on the site
Hi Eric,
Thanks for you feedback. Since the TEXTJOIN is a rather new function, it was not there when we wrote the instruction. I will include the function in the article. Thanks so much.
Amanda
This comment was minimized by the moderator on the site
Major time saving technique - thank you!
This comment was minimized by the moderator on the site
Doesn't work, too many arguments in function.
This comment was minimized by the moderator on the site
This was a life saver! Thanks
This comment was minimized by the moderator on the site
Can someone help in converting a cell wish Value

Football, Baseball, Cricket

into


1. Football, 2. Baseball, 3. Cricket
This comment was minimized by the moderator on the site
Hi ADMINDIVISION,
You can use the Text to Columns (Excel built-in feature) or Split Cells (of Kutools for Excel) to split the cell to three columns or rows, and then apply the Insert Bullets or Numbering feature of Kutools for Excel to quickly insert numbering for the new cells/columns/rows.

Btw, there is an article introducing several solutions to inserting bullets or numberings into cells:https://www.extendoffice.com/documents/excel/950-excel-apply-bullets-numbering.html
This comment was minimized by the moderator on the site
I need to get my numbers to look like this ('1234567', '1234567') instead of ("1234567", "1234567") - any ideas!?
This comment was minimized by the moderator on the site
=SUBSTITUTE(value,CHAR(34),CHAR(39))
This comment was minimized by the moderator on the site
Hi,
There are no double quotas or quotas in the conversation results with any one of methods in this article.
This comment was minimized by the moderator on the site
Absolutely magic!Thanks!
This comment was minimized by the moderator on the site
Used This one: "Convert column list to comma separated list with VBA", worked perfect for converting rows (1000+) of email addresses into a combined list that my email client works well with. Just changed the "," to "; " and it was good to go. Thanks!
This comment was minimized by the moderator on the site
I would like to know how did you manage to copy the comma separated values from Excel Spreadsheet to Outlook/other main client. The reason being whenever I copy, the only formula gets copied but not the comma separated values. Please support.
This comment was minimized by the moderator on the site
Hi, Ravindran, you shold copy the formula result and the paste it into a cell as value firstly, then copy the pased value to other devices.
https://www.extendoffice.com/images/stories/comments/sun-comment/paste%20as%20value.png?1697765930000
This comment was minimized by the moderator on the site
Hi All, So for a few columns this formula is great, but if you were trying to figure this out on more cloumns more than 100. putting "&" is a waste of time. For me i needed sepration through "," (comma). for that, all you need to do is to separate the file in CSV, Open it on a Notepad, Copy and paste in in Word, then Copy again from Word and paste it on Excel. Hope you like to the suggested, Have a great day. Thank you, Mayank Bhargava
This comment was minimized by the moderator on the site
The VBA helped out so much! I am experiencing an issue if you try to close the pop up box or cancel it, it will show that the vba needs debugged. This also happens if the value is blank. Any ideas on how to fix this? Thanks!
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations