3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Breaking apart text using Excel

Breaking apart text using Excel
This instructable will show you how to break apart (in computer lingo, parse) text using Excel. The instructable will introduce you to some of the text-handling commands in Excel. This instructable will be based on Excel 2007, but will work in any recent version of the software. The technique can be applied to a wide range of data.
 
Remove these adsRemove these ads by Signing Up
 

Step 1Build your list of names

Build your list of names
In Cell A1, enter the column header Name. Frequently lists will have names in the form Last, First. Enter some names to work with. In computer lingo, a group of text characters like our names here is called a string.
« Previous StepDownload PDFView All StepsNext Step »
26 comments
Dec 11, 2011. 10:58 PMjakesty says:
There are many ways to do these steps often, but given the above, it is really not the best choice in identifying the piece after the comma.
1. bad use of memory. If you have tens of thousands of rows, wasting this much memory will also slow down processing.
2. what if some records go beyond 100 characters? Now you need to rewrite everything.
This is not worth the problems. Use the tools that were partially given here in a different format.
The TRIM command is nice for removing unwanted spaces, use the FIND to locate that comma and identify how much space to the right of the comma is needed. And Voila, a perfectly formatted cell every time.

Place this in D2
=TRIM(RIGHT(B2,FIND(",",B2)-1))
Oct 8, 2011. 7:58 PMdilip.markule says:
very informational...... Thanks....!
Sep 20, 2011. 10:29 AMbkothapalli says:
sir i have an interest in developing a special software what r the requirements for that plez tel me sir
Jul 15, 2011. 9:50 PMharoonshaikh786 says:
Thanks, very informative and nicely done.............making understand excel language in simple English..................Gotta query............can i post
Jun 13, 2011. 4:09 PMjohnpoole says:
good ole microsoft.. a dozen ways to do everything.. ctrl a crtl c, right click the desktop new text.. enter enter, (opens the txt file) crtl v, paste the names and comma's to the txt.. save as comma delimited, close open with excel and you will get two columns..

of course just one more way, takes me about 1 minute.. when i need to send names back to my nortel switch via a script i can not use the comma and have to use txt to clear the carriage return at the end of each excel script paste..

send a1 gives me the content of a1 and a return.. turning the excel into a txt, i drop the carriage return.. then i can insert the space.. another great reason to use linux.. tied the mr gates at work, but when i have the choice.. linux, dsl
May 14, 2011. 6:10 PMttibbenham says:
I like your technique. Excel also has a built-in 'text to columns' feature ( under Data in Excel 2007 ) which does something similar.
Dec 29, 2010. 6:25 AMDr.Paj says:
If there aren't any ridiculous spaces in A1, I usually do
=left(A1,find(", ",A1)-1)
for the last name (if their last name comes first in the list) and
=right(A1,len(A1)-find(", ",A1)-1)
for the first name. The formulas assume the person entered in the names correctly in the first place though. I guess you could use these formulas for B1 since you already have it trimmed.
Oct 26, 2010. 1:24 AMmhacy says:
Great! thanks!
Jan 15, 2010. 7:03 AMmissplumeau says:
 I wish I had found your great Instructable years ago! I am going to use it a lot from now on. Thank you for this clear and very well written Ible!!
May 28, 2009. 8:18 PMconfused73 says:
Thanks a million !!! Working on a project and this saved time.
Feb 2, 2009. 1:48 PMtabgilbert says:
Very good. Lots of detailed information in an easy to understand format.
Jan 29, 2009. 8:03 PMnailz7 says:
thanks, learnt something new today
Jan 28, 2009. 10:11 AMCAR_RAMROD says:
I always knew this was possible in Excel, I just never knew how. Very well explained, I am certain i will use this.
Jan 28, 2009. 12:28 AMomnibot says:
Good ible .. and it's compatible with Calc in OpenOffice.org
Jan 27, 2009. 4:40 PMdchall8 says:
Both of those are good to know. Thanks!
Jan 27, 2009. 1:03 PMmnapier61 says:
Excellent! Thanks!
Jan 27, 2009. 8:10 AMJakeTobak says:
There's a tool called "Text to Columns" that does this pretty easily. It's under Data tab and in the Data Tools section in 2007, idk where it is in earlier versions. You can tell it to deliminate by a couple of common choices like tabs, commas and spaces or define your own. You might still need to use the Trim function though if you have extra spaces.

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
28
Followers
5
Author:KEUrban
I am an administrator at a college, responsible for academic and student affairs. In a previous life, I was a human factors engineer and human performance researcher. I have post-graduate degrees in ...
more »