This article will show you how to split strings in Excel.
Join the channel Telegram of the AnonyViet 👉 Link 👈 |
The problem we need to solve is telling Excel where we want to split the string. In the Smith case, Mike’s comma is at 6 while in the Williams case, Janet’s comma is at 9.
How to split a string in Excel
1. To get the name, use the formula below.
Explanation: to find the position of the comma we use the FIND function (position 6). To get the length of a string, use the LEN function (11 characters). =RIGHT(A2, LEN(A2)-FIND(“,”,A2) -1) to =RIGHT(A2,11-6-1). =RIGHT(A2,4) extracts the rightmost 4 characters and gives the desired result (Mike).
2. To get the last name, use the following formula.
Explanation: to find the position of the comma we use the FIND function (position 6). =LEFT (A2, FIND (“,”, A2) -1) to =LEFT(A2,6-1). =LEFT(A2,5) extracts the leftmost 5 characters and gives the desired result (Smith).
3. Select the range B2:C2 and drag it down.
In addition, you can also view many other excel articles here.