Share Bài 142: Cách tách chuỗi trong Excel

kienlam768

New member
### Cách chia một chuỗi trong Excel

Trong bài viết này, chúng tôi sẽ chỉ cho bạn cách chia một chuỗi trong Excel.Chúng tôi sẽ sử dụng ví dụ về bộ dữ liệu chứa tên nhân viên và các bộ phận của họ.Chúng tôi sẽ phân chia tên từ các bộ phận để chúng tôi có thể tạo một danh sách riêng các tên và một danh sách riêng các phòng ban.

## Bước 1: Tìm vị trí của dấu phân cách

Bước đầu tiên là tìm vị trí của dấu phân cách.Trong ví dụ của chúng tôi, dấu phân cách là dấu phẩy.Chúng ta có thể sử dụng hàm `find` để tìm vị trí của dấu phẩy.

`` `
= Tìm (",", A2)
`` `

Công thức này sẽ trả về vị trí của dấu phẩy trong ô A2.Trong ví dụ của chúng tôi, dấu phẩy nằm ở vị trí thứ sáu.

## Bước 2: Trích xuất tên và bộ phận

Bây giờ chúng ta đã biết vị trí của dấu phân cách, chúng ta có thể trích xuất tên và bộ phận từ tế bào.Chúng ta có thể sử dụng các công thức sau để làm điều này:

`` `
= Trái (A2, Tìm (",", A2) -1)
= Phải (A2, Len (A2) -Find (",", A2) -1)
`` `

Công thức đầu tiên sẽ trích xuất tên từ ô.Công thức thứ hai sẽ trích xuất bộ phận từ tế bào.

## Bước 3: Sao chép các công thức vào các ô khác

Bây giờ chúng ta có các công thức, chúng ta có thể sao chép chúng vào các ô khác trong bộ dữ liệu.Để làm điều này, chúng ta có thể sử dụng tay cầm điền.

## Bước 4: Định dạng dữ liệu

Khi các công thức đã được sao chép vào các ô khác, chúng ta có thể định dạng dữ liệu.Chúng ta có thể sử dụng các bước sau để làm điều này:

1. Chọn phạm vi của các ô chứa dữ liệu.
2. Nhấp vào tab ** dữ liệu ** trên ruy băng.
3. Nhấp vào nút ** văn bản vào cột **.
4. Thực hiện theo các hướng dẫn trên màn hình để chuyển đổi dữ liệu thành các cột.

## Kết quả

Sau khi làm theo các bước này, chúng tôi sẽ có hai danh sách dữ liệu riêng biệt: một danh sách tên và một danh sách các bộ phận.

## Phần kết luận

Trong bài viết này, chúng tôi đã chỉ cho bạn cách chia một chuỗi trong Excel.Chúng tôi đã sử dụng ví dụ về bộ dữ liệu có chứa tên nhân viên và các bộ phận của họ.Chúng tôi phân chia tên từ các bộ phận để chúng tôi có thể tạo một danh sách riêng các tên và một danh sách riêng các phòng ban.
=======================================
### How to split a string in Excel

In this article, we will show you how to split a string in Excel. We will use the example of a dataset containing employee names and their departments. We will split the names from the departments so that we can create a separate list of names and a separate list of departments.

## Step 1: Find the position of the delimiter

The first step is to find the position of the delimiter. In our example, the delimiter is a comma. We can use the `FIND` function to find the position of the comma.

```
=FIND(",", A2)
```

This formula will return the position of the comma in cell A2. In our example, the comma is in the sixth position.

## Step 2: Extract the name and department

Now that we know the position of the delimiter, we can extract the name and department from the cell. We can use the following formulas to do this:

```
=LEFT(A2, FIND(",", A2)-1)
=RIGHT(A2, LEN(A2)-FIND(",", A2)-1)
```

The first formula will extract the name from the cell. The second formula will extract the department from the cell.

## Step 3: Copy the formulas to the other cells

Now that we have the formulas, we can copy them to the other cells in the dataset. To do this, we can use the fill handle.

## Step 4: Format the data

Once the formulas have been copied to the other cells, we can format the data. We can use the following steps to do this:

1. Select the range of cells that contains the data.
2. Click the **Data** tab on the ribbon.
3. Click the **Text to Columns** button.
4. Follow the on-screen instructions to convert the data to columns.

## Result

After following these steps, we will have two separate lists of data: one list of names and one list of departments.

## Conclusion

In this article, we showed you how to split a string in Excel. We used the example of a dataset containing employee names and their departments. We split the names from the departments so that we could create a separate list of names and a separate list of departments.
 
Join Telegram ToolsKiemTrieuDoGroup
Back
Top