Basic One-Column and Multi-Column Data Sorting in Excel Spreadsheets
A simple but very powerful tool
Two of Excel’s primary functions are to allow you to manipulate and view data from different perspectives, and one of the program’s more simple but powerful tools for doing so is theSortfunction.
Whether it’s simple ascending/descending sorts, sorting on more than one variable to display data in groups or to maintain row integrity, or simple alphanumeric sorts to keep your tabular data orderly, sorting data in Excel is an essential skill.
Few programs are better suited for sorting tabular data than Excel, and your sorts can run from the simple and relatively uncomplicated to the highly sophisticated. While Excel’s sorting prowess—what you can do with the right data set and a little knowledge of the inner workings of the program—is indeed robust and in-depth, today’s tech tip focuses on two basic types of sorts, as follows:
Spreadsheets are, of course, made up of columns and rows of cells, or tabular data, where each column comprises a logical division of facts, figures, or any other details by category, such as, say, names, addresses, currency, parts numbers, and so on—depending on the type of spreadsheet. Rows, on the other hand, display people, objects, or figures side-by-side or in the same instance or occurrence.
Depending on the type of spreadsheet and the data it contains, such as a tabular list of names, addresses, phone numbers, and other pertinent data, rows are frequently similar to database records.
When you sort rows of data, each row must maintain its integrity, without inadvertently moving data from one row to another, which, as you’ll see further down, is where sorting data on multiple columns comes in handy.
Sorting on a Single Field
You can sort the records in your spreadsheet by rows, and you can sort the cells within records by columns. You can, of course, specify ascending or descending sort orders. By default, ascending / alphanumerically, the program arranges text fromAtoZand numbers from smallest to largest. Sorting with a descending sort order, of course, reverses the older fromZtoA, or so that larger numbers start at the top.
As with many functions in Excel, there are a few ways to perform a simple sort; everything you need for this type of sort, though, resides on the right mouse button flyout-menu, as shown below.
This simple sort works for many types of data, except when your rows and columns have identical, or duplicate, data. In these instances, you must sort on two or more columns, coming up next.
Sorting Records on Multiple Fields
Depending on the complexity of your data, you may need to sort on more than one column. Perhaps the best example is sorting a database alphabetically in last-name order. Say that your data has several people with the same last names. In these instances, you’ll want to make sure that Linda Johnson comes before Lydia Johnson, and Cherri Anderson displays after Charles Anderson…You get the idea.
You can set up custom searches with multiple criteria from the Sort dialog box, like this.
Clicking around in the Sort dialog box reveals several different options for modifying your sorts, though some of them, unless you know exactly how each one affects your sort, will most likely produce unwanted results.
Besides, when you choose a column, Excel analyzes the contents of the cells in that column and makes educated guesses as to what values should populate theSort onandOrderfields. Unless you have a specific (and logical) reason for changing these, don’t. (Unless you’re experimenting, of course. I always encourage that—and Excel’s Undo feature works marvelously.)
As I’m sure you can imagine, this is just the beginning of how you can sort data in Excel. It’s important to remember, though, that unless you’re careful, using the wrong parameters can juxtapose your data and completely change its position in the spreadsheet. Sort is fast and easy to setup. The good news is that Undo is fast, too. Don’t be afraid to Undo and try again. And again.
Currently a contributing editor at PCMag, William Harrel has been writing about computer technology for more than 30 years, since well before the advent of the internet and has authored or coauthored more than 20 books.Read William’s Full Bio
Welcome to Help Desk Geek- a blog full of tech tips from trusted tech experts. We have thousands of articles and guides to help you troubleshoot any issue. Our articles have been read over 150 million times since we launched in 2008.
HomeAbout UsEditorial StandardsContact UsTerms of Use
Copyright © 2008-2024 Help Desk Geek.com, LLC All Rights Reserved