Text to Columns in Excel
Text to Columns in Excel
Examples
-- By Sumit Bansal - https://trumpexcel.com/excel-text-to-columns-examples/
This can be really helpful when you get your data from databases
or you import it from other file formats such as Text or CSV.
In this tutorial, you’ll learn about many useful things that can be
done using Text to Columns in Excel.
o Example 1 – Split Names into the First Name and Last Name
numbers
This wizard has three steps and takes some user inputs before
splitting the text into columns (you will see how these different
options can be used in examples below).
Now let’s dive in and see some amazing stuff you can do with
Text to Columns in Excel.
Click on Finish.
This would instantly give you the results with the first name in one
column and last name in another column.
Note:
This technique works well when you the name constitutes of
the first name and the last name only. In case there are
initials or middle names, then this might not work. Click
here for a detailed guide on how to tackle cases with
different combinations of names.
The result you get from using the Text to Columns feature is
static. This means that if there are any changes in the
original data, you’ll have to repeat the process to get
updated results.
Also read: How to Sort by the Last Name in Excel
Here are the steps to split these usernames and domain names
using the Text to Columns feature.
This would split the email address and give you the first name
and the last name in separate cells.
Change the destination cell to the one where you want the
result.
Click on Finish.
This would split the URL and give you the root domain (in the
third column as there were two forward slashes before it).
Note: This works well when you have all the URLs that have
http:// in the beginning. If it doesn’t, then you will get the root
domain in the first column itself. A good practice is to make these
URLs consistent before using Text to Columns.
Suppose you have dates in the below format (which are not in the
valid Excel date format).
Here are the steps to convert these into valid date formats:
Click on Finish.
This would instantly convert these invalid date formats into valid
date formats that you can use in Excel.
The problem with this is that these numbers (which are in text
format) are ignored by Excel functions such as SUM and
AVERAGE.
Click on Finish.
This would convert these numbers back into General format that
can now be used in formulas.
These could be the case when you have transactional data, and
the first five characters (or any other number of characters)
represent a unique identifier.
For example, in the data set shown below, the first five characters
are unique to a product line.
Here are the steps to quickly extract the first five characters from
this data using Text to Columns:
Click on Finish.
This would split your data set and give you the first five characters
of each transaction id in one column and rest all in the second
column.
Note: You can set more than one vertical line as well to split the
data into more than 2 columns. Just click anywhere in the Data
Preview area and drag the cursor to set the divider.
Click on Finish.
This would instantly place the minus sign from the end of the
number of the beginning of it. Now you can easily use these
numbers in formulas and calculations.
You May Also Like the Following Excel Tutorials:
CONCATENATE Excel Ranges (with and without separator)
Automatically
How to Transpose Data in Excel.