ไปยังเนื้อหาหลัก

วิธีแบ่งข้อความตามช่องว่าง / ลูกน้ำ / ตัวคั่นใน Excel

หากคุณมีรายการคอลัมน์ของข้อมูลและต้องการแบ่งออกเป็นหลายคอลัมน์โดยใช้ตัวคั่นเฉพาะเช่นเดียวกับภาพหน้าจอด้านล่างที่แสดงคุณจะแบ่งข้อมูลเหล่านี้ใน Excel ได้อย่างไร? ผู้ใช้บางคนอาจนึกถึงฟังก์ชัน Text to Column เท่านั้น แต่ตอนนี้ฉันจะแนะนำไม่เพียง แต่ฟังก์ชัน Text to Columns เท่านั้น แต่ยังรวมถึงโค้ด VBA สำหรับคุณด้วย


แยกสตริงข้อความออกเป็นหลายคอลัมน์โดยใช้ช่องว่าง / ลูกน้ำ / ตัวคั่นด้วยคุณสมบัติ Text to Columns

คุณลักษณะ Text to Columns มีประโยชน์มากในการแบ่งรายการเป็นหลายคอลัมน์ใน Excel วิธีนี้กำลังพูดถึงวิธีการแยกข้อมูลโดยใช้ตัวคั่นที่ระบุด้วยฟีเจอร์ Text to Column ใน Excel โปรดดำเนินการดังนี้:

1. เลือกรายการคอลัมน์ที่คุณต้องการแยกตามตัวคั่นแล้วคลิก ข้อมูล > ข้อความเป็นคอลัมน์. ดูภาพหน้าจอ:

2. จากนั้นก แปลงข้อความเป็นคอลัมน์ตัวช่วยสร้าง กล่องโต้ตอบจะปรากฏขึ้นและตรวจสอบ ที่คั่น แล้วคลิก ถัดไป ปุ่ม. ดูภาพหน้าจอ:

3. ในกล่องโต้ตอบเปิด Convert to Text to Columns - ขั้นตอนที่ 2 จาก 3 โปรดตรวจสอบตัวคั่นที่คุณต้องการแยกข้อมูลตาม

หมายเหตุ: หากคุณต้องการแยกสตริงข้อความของคุณด้วยตัวคั่นพิเศษโปรดตรวจสอบไฟล์ อื่นๆ จากนั้นพิมพ์ตัวคั่นลงในกล่องต่อไปนี้

4 คลิก เสร็จสิ้น. ตอนนี้คุณสามารถเห็นรายการคอลัมน์ในการเลือกได้ถูกแบ่งออกเป็นหลายคอลัมน์โดยตัวคั่นที่ระบุ

แยกตัวเลข (หรือข้อความ) จากเซลล์ / คอลัมน์เดียวลงในคอลัมน์ / แถวต่างๆ

Kutools สำหรับ Excel ช่วยเพิ่มไฟล์ แยกเซลล์ ยูทิลิตี้และรองรับแบทช์แยกอักขระข้อความหรือตัวเลขทั้งหมดจากเซลล์ / คอลัมน์หนึ่งออกเป็นสองคอลัมน์ / แถว



Kutools สำหรับ Excel - เพิ่มประสิทธิภาพ Excel ด้วยเครื่องมือที่จำเป็นมากกว่า 300 รายการ เพลิดเพลินกับฟีเจอร์ทดลองใช้ฟรี 30 วันโดยไม่ต้องใช้บัตรเครดิต! Get It Now

แยกสตริงข้อความออกเป็นหลายแถว / คอลัมน์โดยเว้นวรรค / ลูกน้ำ / ตัวคั่นด้วย Kutools for Excel

วิธีการข้างต้นสามารถแยกสตริงข้อความออกเป็นหลายคอลัมน์เท่านั้น วิธีนี้จะแนะนำ Kutools for Excel's แยกเซลล์ ยูทิลิตี้ในการแยกสตริงข้อความออกเป็นหลายแถวหรือคอลัมน์โดยใช้ตัวคั่นที่ระบุใน Excel ได้อย่างง่ายดาย

Kutools สำหรับ Excel - เต็มไปด้วยเครื่องมือที่จำเป็นสำหรับ Excel มากกว่า 300 รายการ เพลิดเพลินกับฟีเจอร์ทดลองใช้ฟรี 30 วันโดยไม่ต้องใช้บัตรเครดิต! ดาวน์โหลดเดี๋ยวนี้!

1. เลือกช่วงที่คุณจะแยกสตริงข้อความ (ในกรณีของเราเราเลือกช่วง A1: A9) แล้วคลิก Kutools > ข้อความ > แยกเซลล์.
doc แยกข้อความ 01

2. ในการเปิดกล่องโต้ตอบแยกเซลล์โปรดตรวจสอบ แบ่งเป็นแถว option หรือ แยกเป็นคอลัมน์ ตัวเลือกตามที่คุณต้องการในไฟล์ ชนิดภาพเขียน ถัดไประบุตัวคั่นใน ระบุตัวคั่น ส่วนและคลิกปุ่ม Ok ปุ่ม. ดูภาพหน้าจอด้านบน:

ตอนนี้กล่องโต้ตอบแยกเซลล์อื่นจะปรากฏขึ้นโปรดเลือกเซลล์แรกของช่วงปลายทางแล้วคลิกไฟล์ OK ปุ่ม
doc แยกข้อความเป็นแถวคอลัมน์ 10

Kutools สำหรับ Excel - เพิ่มประสิทธิภาพ Excel ด้วยเครื่องมือที่จำเป็นมากกว่า 300 รายการ เพลิดเพลินกับฟีเจอร์ทดลองใช้ฟรี 30 วันโดยไม่ต้องใช้บัตรเครดิต! Get It Now


การสาธิต: แยกสตริงข้อความออกเป็นหลายแถว / คอลัมน์โดยเว้นวรรค / ลูกน้ำ / ตัวคั่น


Kutools สำหรับ Excel: เครื่องมือแสนสะดวกกว่า 300 รายการอยู่แค่เพียงปลายนิ้วสัมผัส! เริ่มทดลองใช้ฟรี 30 วันโดยไม่มีข้อจำกัดด้านฟีเจอร์ตั้งแต่วันนี้ Download Now!


บทความญาติ:

สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

🤖 Kutools AI ผู้ช่วย: ปฏิวัติการวิเคราะห์ข้อมูลโดยยึดตาม: การดำเนินการที่ชาญฉลาด   |  สร้างรหัส  |  สร้างสูตรที่กำหนดเอง  |  วิเคราะห์ข้อมูลและสร้างแผนภูมิ  |  เรียกใช้ฟังก์ชัน Kutools...
คุณสมบัติยอดนิยม: ค้นหา เน้น หรือระบุรายการที่ซ้ำกัน   |  ลบแถวว่าง   |  รวมคอลัมน์หรือเซลล์โดยไม่สูญเสียข้อมูล   |   รอบโดยไม่มีสูตร ...
การค้นหาขั้นสูง: VLookup หลายเกณฑ์    VLookup หลายค่า  |   VLookup ข้ามหลายแผ่น   |   การค้นหาที่ไม่ชัดเจน ....
รายการแบบเลื่อนลงขั้นสูง: สร้างรายการแบบหล่นลงอย่างรวดเร็ว   |  รายการแบบหล่นลงขึ้นอยู่กับ   |  เลือกหลายรายการแบบหล่นลง ....
ผู้จัดการคอลัมน์: เพิ่มจำนวนคอลัมน์เฉพาะ  |  ย้ายคอลัมน์  |  สลับสถานะการมองเห็นของคอลัมน์ที่ซ่อนอยู่  |  เปรียบเทียบช่วงและคอลัมน์ ...
คุณสมบัติเด่น: กริดโฟกัส   |  มุมมองการออกแบบ   |   บาร์สูตรใหญ่    สมุดงานและตัวจัดการชีต   |  ห้องสมุดทรัพยากร (ข้อความอัตโนมัติ)   |  เลือกวันที่   |  รวมแผ่นงาน   |  เข้ารหัส/ถอดรหัสเซลล์    ส่งอีเมลตามรายการ   |  ซุปเปอร์ฟิลเตอร์   |   ตัวกรองพิเศษ (กรองตัวหนา/ตัวเอียง/ขีดทับ...) ...
ชุดเครื่องมือ 15 อันดับแรก12 ข้อความ เครื่องมือ (เพิ่มข้อความ, ลบอักขระ, ... )   |   50 + แผนภูมิ ประเภท (แผนภูมิ Gantt, ... )   |   40+ ใช้งานได้จริง สูตร (คำนวณอายุตามวันเกิด, ... )   |   19 การแทรก เครื่องมือ (ใส่ QR Code, แทรกรูปภาพจากเส้นทาง, ... )   |   12 การแปลง เครื่องมือ (ตัวเลขเป็นคำ, การแปลงสกุลเงิน, ... )   |   7 ผสานและแยก เครื่องมือ (แถวรวมขั้นสูง, แยกเซลล์, ... )   |   ... และอื่น ๆ

เพิ่มพูนทักษะ Excel ของคุณด้วย Kutools สำหรับ Excel และสัมผัสประสิทธิภาพอย่างที่ไม่เคยมีมาก่อน Kutools สำหรับ Excel เสนอคุณสมบัติขั้นสูงมากกว่า 300 รายการเพื่อเพิ่มประสิทธิภาพและประหยัดเวลา  คลิกที่นี่เพื่อรับคุณสมบัติที่คุณต้องการมากที่สุด...

รายละเอียด


แท็บ Office นำอินเทอร์เฟซแบบแท็บมาที่ Office และทำให้งานของคุณง่ายขึ้นมาก

  • เปิดใช้งานการแก้ไขและอ่านแบบแท็บใน Word, Excel, PowerPoint, ผู้จัดพิมพ์, Access, Visio และโครงการ
  • เปิดและสร้างเอกสารหลายรายการในแท็บใหม่ของหน้าต่างเดียวกันแทนที่จะเป็นในหน้าต่างใหม่
  • เพิ่มประสิทธิภาพการทำงานของคุณ 50% และลดการคลิกเมาส์หลายร้อยครั้งให้คุณทุกวัน!
Comments (29)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi
I have a string like a, b,c,d,,a,d,e,f,a,b,f... etc. I want to replace a value of 'd' which having a Position of 7th after delimiter. Can you suggest how to find a position after delimiter and replace exact Position value.
This comment was minimized by the moderator on the site
Hi, Kanchan, here is a code you can try:
Sub changeText()
    Dim xSplit, xStr As String
    Dim xPos As Integer
    Dim xArr As Variant
    Dim xRng, xSetRng As Range
    On Error Resume Next
    Set xRng = Application.InputBox("Select the cell you want to extract:", "Kutools for Excel", , , , , , 8)
    xSplit = Application.InputBox("Type the delimiter:", "Kutools for Excel", , , , , , 2)
    xPos = Application.InputBox("Type nth delimiter:", "Kutools for Excel", , , , , , 1)
    xStr = Application.InputBox("Type the string or character you want to replace with:", "Kutools for Excel", , , , , , 2)
    Set xSetRng = Application.InputBox("Select the cell to place result:", "Kutools for Excel", , , , , , 8)
    xArr = Split(xRng.Text, xSplit)
    xArr(xPos) = xStr
    xSetRng.Value = Join(xArr, ",")
End Sub

Hope it can help you.
This comment was minimized by the moderator on the site
hi ,

i have flat file which having delimiter so i want to read the value of passing position having before and after delimiter. is there any way to get these vale
This comment was minimized by the moderator on the site
Hi, I do not understand your problem clearly. If you want to get the values before and after a specific delimiter separately, the both of methods mentioned in this tutorial can help you, you just need to change the delimiter to your need, and follow the steps to finish. Or you can give me more details about your problem for me to get it clearly.
This comment was minimized by the moderator on the site
Thank you This Saved my time !
This comment was minimized by the moderator on the site
thanks so much, this really made my life easier!
This comment was minimized by the moderator on the site
How do we split kyzwell5konfgwell3k into columns. I need only the on has to be selected as delimit and separate into two words.
This comment was minimized by the moderator on the site
Hi Sunny,
The Text to Columns (Excel built-in feature) supports to split a cell to columns by a given character, and the Split Cells feature of Kutools for Excel also supports to split cells by one character.
If you need to split cells by a string of characters, you’d better apply a VBA macro.
This comment was minimized by the moderator on the site
This just shows how horrible excel is...how about a SPLIT function?? Duh...
This comment was minimized by the moderator on the site
Hi Bob,
Kutools for Excel has released this feature – Split Cells. This feature can not only split cells by all kinds of delimiters to columns, but also split cells to rows. What’s more, it supports to split number and text from selected cells too.
This comment was minimized by the moderator on the site
Ok, so here is a problem I am stuck on that I cannot seem to resolve. I am looking to break up a long string of text with the following requirements:
1) Text can only be broken up at a space (not in the middle of a word)
2) The total length for each parsed cell must be as close to 40 characters as it can get using the space rule above.

For example, this comes in a single cell: "It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief". In this example, I would expect the formula to break up this text into 4 cells:

It was the best of times, it was the
worst of times, it was the age of
wisdom, it was the age of foolishness,
it was the epoch of belief

I keep getting wrapped around the axle trying to use a combo of left,mid,right and search/find formulas, but not only is it very inelegant, but as soon as I run into a non-unique word, my find formula breaks down.
This comment was minimized by the moderator on the site
Thanks. It is really helpful.
This comment was minimized by the moderator on the site
Hello, How do i separete a long sentence into columns like


12534_MK_EC0102-Kanyuambora_OUTA 172.22.118.13 255.255.255.192 172.22.118.1. I need the process of separating to columns of: Site ID 12534_MK_EC0102; Site Name Kanyuambora_OUTA;IP 172.22.118; Mask 255.255.255; Gateway 172.22.118.1. Kindly assist.
This comment was minimized by the moderator on the site
Hi Cosmas,
How do you want to split the lone sentences by? In your example, you can split the sentence by the delimiter “_” or “;” or “.”
Just try them as you need!
This comment was minimized by the moderator on the site
You can use the FIND and LEN commands to separate fields, for example :
A1: 12534_MK_EC0102-Kanyuambora_OUTA 172.22.118.13 255.255.255.192 172.22.118.1.
B1: =FIND(" ",$A$1) B2: =FIND(" ",$A$1,B1+1) B3: "Fill Down From B2"
C1: =LEFT($A$1,B1) C2: =RIGHT(LEFT($A$1,B2),B2-B1) C3: "Fill Down From C2"
This comment was minimized by the moderator on the site
Hi Cosmas,
You can apply the Text to Columns feature on the Data tab in Excel Ribbon. In the Wizard, please set both delimiters of space and custom delimiters -, and it will split your long cell content to desired columns.
This comment was minimized by the moderator on the site
Thank you so much for posting this, it's really very helpful at times.
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