Our website will be down for scheduled maintenance on Thursday, September 18, at 11 p.m. Pacific Time and should be back up by Midnight. We apologize for any inconvenience.

Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

Using Sort to eliminate empty rows and columns

From: Cleaning Up Your Excel 2010 Data

Video: Using Sort to eliminate empty rows and columns

Sometimes in order to clean up your data, you may need to add temporary columns and use various sorting techniques to give you the tools for eliminating empty rows or unnecessary rows in a list. In this particular worksheet called ExtraRows, recognize that when there is a department change here, a row has been added to indicate the department name over here in Column A. And these are going to get in the way when we do sorting and filtering and trying to do pivot tables on a worksheet like this. And similarly, the next sheet over called EmptyRows has a similar layout, except here there are empty rows. And perhaps that's going to look nice on a sheet of paper when it's printed--it nicely delineates the departments-- but in order to use Excel efficiently, when it comes to database tools like sorting and filtering, we need to get rid of rows like this.

Using Sort to eliminate empty rows and columns

Sometimes in order to clean up your data, you may need to add temporary columns and use various sorting techniques to give you the tools for eliminating empty rows or unnecessary rows in a list. In this particular worksheet called ExtraRows, recognize that when there is a department change here, a row has been added to indicate the department name over here in Column A. And these are going to get in the way when we do sorting and filtering and trying to do pivot tables on a worksheet like this. And similarly, the next sheet over called EmptyRows has a similar layout, except here there are empty rows. And perhaps that's going to look nice on a sheet of paper when it's printed--it nicely delineates the departments-- but in order to use Excel efficiently, when it comes to database tools like sorting and filtering, we need to get rid of rows like this.

So let's tackle both cases. Back to the sheet that has the extra rows. If we could somehow sort the data to pull these all together, then we can easily delete them without having to painstakingly go through and delete these one by one. So let's insert a new column to the left of Column A. Right-click Column A and insert. And starting on A2, let's put in the number 1, and then right below it, the number 2. The data in Column B is contiguous all the way to the bottom. So we can simply select Cells A2 and A3, double-click the lower right-hand corner, and if we now press Ctrl+Period-- this will take us down to the bottom-- we can see that we've copied in a sequence number for every one of these rows.

Let's go back to the top. Give it a temporary heading. It doesn't really have to be anything really, but just to make sure that we've got some kind of a heading up there, we'll call it sequence. Remember, we are going to be getting rid of that column. Let's sort the data now in such a way that these kinds of rows, like this one and this one, end up at the top or the bottom. So all we really need to do is to click, for example, in one of our columns that's got an empty cell in it, like this. Now we wouldn't do this in Column I, because there, there are some empty cells that have a reason for being empty.

Some people don't have benefits. But in Column C, let's say we've got our data all filled in. No empty cells here, except in these kinds of rows, like these two. So we can just click somewhere in Column C and then on the Data tab use the AZ button to sort our data based on the data in Column C. There we are. And at the bottom of this list, we hope we'll have all of those Column C entries that were empty. This should be at the bottom. And we don't need them.

We want to get rid of them. So let's select the rows over here and simply right-click and delete those rows. And now we want to go back to the original sequence here. It looks like it might be there anyway, but just in case, we do have our data still available in Column A, we can click AZ just to make sure, jump to the top here. It looks like things are looking pretty good. We don't need that sequence column anymore. Simply right-click and Delete. And similarly, in the EmptyRows worksheet, same general idea.

Slightly different here because as we create our formula, we are going to have special needs for copying it down the column. So we need to insert a new column here, and as in the previous example, put in a 1 and 2, but we really can't double- click here because it will just stop right there at Row 6. So what we'll need to do here, starting here or from the top, just drag this to the bottom--and hopefully you don't have thousands and thousands of rows. So that's taking a little bit of time to do this, a little bit longer perhaps. But other than this, the same general idea that we saw in the previous example.

We've got our data there. Pressing Ctrl+Period to go back up top there. There we are. Let's put a temporary name up there again. And simply sort on one of our columns, any column, Column B, for example. Let's try ZA, just to show what would happened. It still puts the empty rows at the bottom, and there they are down there. And so, we don't really need any of these data down here. We don't really have to delete the entire row; just delete the sequence numbers. Even there, possibly you don't even need to do that. But as we click here in Column A and do another AZ Sort, press Ctrl+Home.

Our data is together. We don't have any empty rows. Let's get rid of Column A, and we've cleaned up our data. So sorting techniques do help us at different times for getting rid of those rows that have unusual characteristics that we don't need. And whether it's empty rows, as we saw in this example, or in the previous example on the other worksheet where we had data in those rows, sorting allows us to pull those rows together so we can easily eliminate them.

Show transcript

This video is part of

Image for Cleaning Up Your Excel 2010 Data
Cleaning Up Your Excel 2010 Data

24 video lessons · 16498 viewers

Dennis Taylor
Author

 

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
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

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?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

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 preferencesfrom 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.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

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.