Cleaning Up Your Excel 2010 Data
Illustration by John Hersey

Combining data from different columns via concatenation


From:

Cleaning Up Your Excel 2010 Data

with Dennis Taylor

Start your free trial now, and begin learning software, business and creative skills—anytime, anywhere—with video instruction from recognized industry experts.

Start Your Free Trial Now

Video: Combining data from different columns via concatenation

Sometimes you need to pull data together from different locations within a worksheet. The data in columns A, B, and C is structured in such a way that it's ideal for sorting by last name, and even first name if necessary. But suppose you want to take that information and create the kind of names that you would put on mailing labels. In Cell D2, for example, what we would like to see here is Mark R. Baker, and just below that, Sheila H. Hansen. We can pull data together by using the Concatenate function or a technique that pulls the data together.
please wait ...
Watch the Online Video Course Cleaning Up Your Excel 2010 Data
1h 26m Appropriate for all Nov 01, 2011

Viewers: in countries Watching now:

In this course, Dennis Taylor explores the functions, commands, and techniques in Excel that restructure data, remove unwanted characters, convert date data into the desired format, and prepare data for efficient analysis. This course helps get data from a business management system file, other database software, a text file, or a poorly designed Excel worksheet into optimal shape for working with in Excel.

Topics include:
  • Moving or inserting rows and columns of data with a simple drag
  • Using Text to Columns
  • Harnessing the Find and Replace command to replace data at the character level
  • Dealing with special characters and wildcards during search
  • Converting dates with text functions
  • Converting text data to values/numbers
  • Checking and correcting spelling mistakes
  • Splitting data into multiple columns via the Text to Columns feature
  • Combining data from different columns via concatenation
Subjects:
Business IT
Software:
Excel
Author:
Dennis Taylor

Combining data from different columns via concatenation

Sometimes you need to pull data together from different locations within a worksheet. The data in columns A, B, and C is structured in such a way that it's ideal for sorting by last name, and even first name if necessary. But suppose you want to take that information and create the kind of names that you would put on mailing labels. In Cell D2, for example, what we would like to see here is Mark R. Baker, and just below that, Sheila H. Hansen. We can pull data together by using the Concatenate function or a technique that pulls the data together.

Let's take a look at both of these. The function is called Concatenate. And we simply want to pull the data from B2-- that's the first name where we see Mark-- comma, and we would also like to see a space after Mark. So double quote, space, double quote, and a comma, and now we want to see the middle initial--it's in C2. Recognize that some of the names below don't have a middle initial. Following the middle initial another comma, double quote, space, double quote, comma, and now the location of the last name-- it's in cell A2. We're done.

That's what it looks like. As we copy this down the column, keep your eye on those rows where there is no middle initial, and they look slightly different. It's like there's an extra space. Now that may or may not be a big problem on a mailing label, but if you want to deal with that issue, what we can do here is actually use another function called Trim, whose general purpose is to remove leading and trailing spaces, but it also converts multiple consecutive inner spaces to simply one space. And we do need an extra parenthesis on the right side here, too.

So changing this and then recopying by double-clicking here, we see what's happening. And that looks slightly different than before, and it looks like only a single space. So what we're doing here, again, using the Concatenate function to pull the data together and using the Trim function to get rid of that multiple spaces when they occur. Now, instead of using Concatenate, another approach is to use the ampersand symbol. So what we don't need here is the actual word concatenate. We do want to get B2, but instead of a comma here, we put in the ampersand-- that's above the number 7 key, the & symbol.

So it's as if we're saying, let's get Mark and the space and the data from C2-- that's the middle one--put in another ampersand in place of the commas in all cases here, and another space and the data in A2. We don't need two parentheses out there, just one. There we go! This is substantially shorter than Concatenate, and if it is clearer to you, perhaps it's the better choice. Let's see what's happening there, recopy these. Everything looks the same as it did before, but for many people a little more direct, a little faster to get to it.

Different techniques for pulling together data from different locations. If this is our final result, of course we copy this all the way down the column here for as long as that might be. And then the final step in many situations like this for creating conversions is to save the data and essentially throw away the formulas. Once again using the right-mouse button drag any edge in any direction. How about up and then down? As soon as we let go of the mouse, Copy Here as Values Only. So that's the pure result that we have. By the way, if you wanted to put in periods, that would take a little bit more work, but that could be done as well.

Probably have to incorporate an if function. It would be substantially longer. Let's say for the moment it's not worth it. It might be faster to just put the periods over in column C. Now, there are certain times when you might want to gather information that involves text and numbers together. You see what's happening in column E and F, just two values there. And here is the Total Price. Let's take a look at what's here already in cell G2. Total Price is, and we're showing a calculation, and yet that calculation isn't that readable.

It certainly isn't a standard way to display a number like that. What we would like to do is show the dollar sign and format it. There are a couple of different ways to do this. One way might be to include this calculation inside of a function called Dollar, which automatically applies currency format. So the data looks like this--much more readable. You won't see a great need for something like this, but it does illustrate the concept. And sometimes the dollar isn't the appropriate choice to make here. so you might want to use fixed-- that's another option--and there are other techniques here as well.

Lots of different choices here for pulling together information from different cells. The more important example we saw earlier here is with the names. And also be aware of certain situations. If you had names like this and you wanted to put them together as "Baker," and then Mark, space, R, you can certainly do that, similar to what we did here in our use of Concatenate or the ampersand approach. Both techniques work fine here for getting data from different sources and pulling them together into one cell.

Find answers to the most frequently asked questions about Cleaning Up Your Excel 2010 Data .


Expand all | Collapse all
please wait ...
Q: Where can I learn more about Excel formulas?
A: Discover more on this topic by visiting Excel formulas on lynda.com.
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

* Estimated file size

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Cleaning Up Your Excel 2010 Data.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Learn more, save more. Upgrade today!

Get our Annual Premium Membership at our best savings yet.

Upgrade to our Annual Premium Membership today and get even more value from your lynda.com subscription:

“In a way, I feel like you are rooting for me. Like you are really invested in my experience, and want me to get as much out of these courses as possible this is the best place to start on your journey to learning new material.”— Nadine H.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.