Excel Practice Test

β–Ά

Sorting data alphabetically is one of those Excel skills you'll use constantly β€” whether you're organizing a contact list, ordering product names, or cleaning up a report before sending it to your manager. Once you know the fastest method for your situation, it takes seconds. But there's more than one way to do it, and picking the wrong approach can leave you with a mess or β€” worse β€” sorted data that looks right but isn't.

The two most common methods are the Data tab ribbon and the keyboard shortcut. If you've got a single column of names and just want A-to-Z order fast, the ribbon button or shortcut (Alt+A+S+A) does the job in one move. No menus, no dialogs β€” just sorted data.

If you're sorting a full table with multiple columns and want to preserve row integrity (so your contact's name stays matched to their email and phone number), you'll use the Sort dialog from Data β†’ Sort instead. The dialog gives you more control: you can pick which column drives the sort, set a secondary sort for tiebreakers, and even sort by cell color or icon rather than value.

Things get a bit trickier when you're dealing with full names. Excel sees "John Smith" as a single text string, so sorting a column of full names gives you A-to-Z by first name β€” not last. "Aaron Miller" comes before "Beth Adams" because A comes before B. That's fine if you want first-name order.

But most directories, rosters, and employee lists need last-name order β€” and for that, you'll either need to separate first and last name in Excel into different columns first, or use a helper column formula to extract just the last name and sort by that. Both approaches are covered in detail below.

And if you're on Excel 365, there's a third option worth knowing: the SORT function. Unlike the ribbon sort β€” which gives you a static, one-time reorder β€” =SORT() returns a dynamic sorted list that updates automatically whenever your source data changes. You add a new name to the list and it drops straight into alphabetical position without you touching anything. It's a game-changer for dashboards and live reports where the underlying data keeps moving.

One more thing before diving in: alphabetical sorting in Excel is case-insensitive by default. "apple" and "Apple" are treated identically β€” they sort in the same position. If case matters for your data (product codes, system identifiers), there's an option in the Sort dialog to enable case-sensitive sorting. It's off by default, but easy to turn on when you need it.

This guide covers every approach: quick A-Z sorts, keyboard shortcuts, right-click methods, sorting by last name with a helper column, multi-level sorts for full names, the SORT function for live data, case-sensitive sorting, and common reasons your sort might not be working. Whether you're using a basic Excel spreadsheet or a formatted table, there's a method here that fits your workflow. Check the how to sort in excel if you want a broader look at all sorting options beyond alphabetical β€” by date, number, color, and custom lists.

Quick Reference: Alphabetical Sort Methods
Ribbon: Data β†’ Sort A to Z | Shortcut: Alt+A+S+A (A-Z) or Alt+A+S+D (Z-A) | Right-click: right-click column header β†’ Sort β†’ Sort A to Z | SORT function: =SORT(A2:A10) (Excel 365, dynamic)
πŸ”΄ Sort Single Column A-Z

Select any cell in the column, then use the Data tab or keyboard shortcut to sort the entire column A to Z instantly.

  • Method: Data β†’ Sort A to Z
  • Shortcut: Alt+A+S+A
  • Works In: All Excel versions
🟠 Sort by Last Name

Full names sort by first name by default. Use a helper column with =MID(A1,FIND(" ",A1)+1,100) to extract last names, then sort by that column.

  • Method: Helper column + Data Sort
  • Formula: =MID(A1,FIND(" ",A1)+1,100)
  • Works In: All Excel versions
🟑 Sort Multiple Columns

Use the Sort dialog (Data β†’ Sort) to add sort levels β€” sort by last name first, then first name as a tiebreaker.

  • Method: Data β†’ Sort β†’ Add Level
  • Max Levels: Up to 64 sort levels
  • Works In: All Excel versions
🟒 SORT Function (365)

=SORT() returns a dynamic alphabetical list that updates automatically when source data changes β€” no manual re-sorting needed.

  • Method: =SORT(A2:A10) in a blank cell
  • Update: Auto-updates with source data
  • Works In: Excel 365 / Excel 2021+

Basic A-Z Sort and the Keyboard Shortcut

The fastest way to sort alphabetically in Excel is to click any cell in the column you want to sort, then head to the Data tab and hit Sort A to Z (the button with the A-over-Z arrow). Excel sorts the entire column β€” or the entire table if your data has multiple columns β€” while keeping rows intact. That last part matters: if column A has names and column B has emails, Excel moves both together so your data stays aligned. No mismatched rows, no orphaned values.

Here's the step-by-step for a single column:

  1. Click any cell in the column you want to sort (e.g., a name column).
  2. Go to the Data tab on the ribbon.
  3. Click Sort A to Z (looks like A↓Z with a down arrow).
  4. If Excel detects adjacent data, it'll ask whether to expand the selection β€” choose Expand the selection to sort the whole table together. If you choose "Continue with current selection", only the column you clicked gets sorted and your row data falls out of alignment β€” almost always not what you want.

The sort happens instantly. No confirmation dialog, no progress bar β€” Excel just reorders your rows and you're done. If it didn't sort the way you expected, Ctrl+Z undoes it immediately.

Keyboard Shortcut: Alt+A+S+A

If you'd rather keep your hands on the keyboard, the excel alphabetical order shortcut is Alt+A+S+A for A to Z, and Alt+A+S+D for Z to A. These are sequential key presses β€” hold Alt, tap A (Data tab), tap S (Sort A to Z menu), then tap A again (Sort A to Z) or D (Sort Z to A). You don't hold them all simultaneously β€” it's a ribbon navigation sequence, not a chord.

This shortcut works in all modern Excel versions and is probably the quickest way to do an excel sort alphabetically once you've memorized it. Click your column first, then fire the shortcut β€” done in under two seconds. Worth memorizing if you sort frequently.

There's also Ctrl+Shift+L to toggle AutoFilter on your range, which adds dropdown arrows to headers β€” those dropdowns include Sort A to Z and Sort Z to A options too. Useful if you're already filtering and want sorting from the same interface.

Right-Click Method

There's a third option that many users overlook: right-click the column header (the letter at the top, like column A), then choose Sort β†’ Sort A to Z. This is handy when you're already working with your mouse and don't want to navigate to the Data tab. Same result, different path. Note that right-clicking the header selects the entire column β€” if your data has a header row, Excel usually recognizes it automatically and keeps it at the top.

You can also right-click any cell within the data (not the header) β†’ Sort β†’ Sort A to Z. This works the same way. Excel uses the column of the cell you right-clicked as the sort key and expands the selection to include the full table automatically.

For a quick how to sort a column in excel, any of these three methods works fine. The ribbon and shortcut are faster for keyboard users; right-click is more intuitive for mouse-first workflows. Pick whichever fits how you work β€” they all produce identical results.

πŸ“‹ Sort by First Name

If your names are already in a First Name column (separate from last name), Excel's default A-to-Z sort works perfectly. Just click any cell in the first name column β†’ Data β†’ Sort A to Z. Excel sorts alphabetically by first name with no extra steps.

If your data is a full name in one cell ("Jane Doe"), the sort still runs A-to-Z β€” but it sorts by the first character of the full string, which means first name order. So "Alice Smith" comes before "Bob Jones" because A comes before B. That's usually fine for first-name sorting. The problem only arises when you need last-name order.

πŸ“‹ Sort by Last Name

Excel doesn't natively know where the last name starts in a full name string. You need a helper column. In a blank column next to your names, enter this formula:

=MID(A2,FIND(" ",A2)+1,100)

This finds the first space in the name, then extracts everything after it β€” which is the last name (or "Last Name" portion for most Western names). Drag it down for all rows. Now sort by the helper column A-to-Z, and your full-name column moves with it β€” giving you last-name alphabetical order. You can hide the helper column after sorting if you don't want it visible.

For more complex name formats (middle names, suffixes like "Jr."), you may need a more advanced formula or consider splitting names into separate columns first.

πŸ“‹ SORT Function (Live)

If you're on Excel 365 or Excel 2021, the SORT function gives you a live alphabetical list that updates automatically. In a blank cell (in a separate area or sheet), enter:

=SORT(A2:A20)

Excel spills a sorted copy of your range starting from that cell. Every time the source data changes β€” you add a name, edit a name, delete a row β€” the sorted output updates instantly. No button-clicking, no re-running a sort. This is especially useful for dashboards or reports where the underlying data changes frequently. The downside: it's read-only output. You can't edit the spilled results directly; you edit the source range instead.

Sorting Names Alphabetically: First Name vs. Last Name

Sorting a column of first names is easy β€” Excel's A-to-Z sort handles it directly. But full names ("Sarah Johnson", "Mike Adams") are trickier because Excel treats the whole string as one unit. When you sort A-to-Z on a full name column, you're sorting by first name. "Aaron Lee" comes before "Beth Carter" because A precedes B. That's often fine for internal lists, but school rosters, employee directories, and contact databases almost always need last-name order.

The cleanest long-term solution is to store first and last names in separate columns from the start. If you haven't done that yet, check out how to separate first and last name in Excel β€” it covers the Flash Fill method (fast, no formulas) and text-to-columns approaches that split your existing data in seconds.

Helper Column Method for Last Name Sort

If splitting the names isn't practical right now, use a helper column. Here's the process:

  1. Insert a blank column next to your names (or use any empty column).
  2. In the first data row, type: =MID(A2,FIND(" ",A2)+1,100)
  3. This extracts everything after the first space β€” your last name.
  4. Copy that formula down to all rows with names.
  5. Click any cell in the helper column.
  6. Go to Data β†’ Sort A to Z.
  7. When prompted, choose Expand the selection so the original name column moves with it.

Your names are now sorted by last name. The helper column can stay hidden (right-click β†’ Hide) or you can delete it after sorting β€” just paste the helper column values back over itself first (Paste Special β†’ Values) if you want to lock in the results before deleting.

Multi-Level Sort for Full Names

If you have separate First Name and Last Name columns and want to sort by last name, then first name as a tiebreaker (so two people named "Smith" get sorted correctly by first name), use the Sort dialog:

  1. Click anywhere in your data.
  2. Go to Data β†’ Sort (opens the Sort dialog).
  3. In the first sort level, set Column to Last Name, Order to A to Z.
  4. Click Add Level.
  5. In the second level, set Column to First Name, Order to A to Z.
  6. Click OK.

Excel sorts by last name first β€” and for any ties, it then sorts by first name. This is how you'd sort names alphabetically in Excel the "correct" way for a proper directory. Excel supports up to 64 sort levels, though most use cases need only two or three. If you're also working with formulas that count across your sorted data, the countifs excel function can help you tally results within your sorted ranges.

One thing worth noting: the multi-level sort dialog is non-destructive β€” it reads your data, sorts it in memory, and writes back the new order. You're not deleting or overwriting values. If the result isn't what you expected, Ctrl+Z reverts it immediately. So don't be afraid to experiment with sort levels until you get the order right.

No merged cells in the sort range β€” merged cells break sorting and cause errors
No blank rows within your data range β€” blank rows split the sort into separate blocks
Text not stored as numbers β€” cells that look like text but are stored as numbers sort numerically, not alphabetically
Remove leading spaces with TRIM β€” a space before a name pushes it to the top of the sorted list
Header row included in selection is recognized β€” check the 'My data has headers' box in the Sort dialog
Data is in a contiguous range β€” gaps or isolated columns can cause Excel to only sort part of your data

The SORT Function for Dynamic Alphabetical Sorting

The SORT function β€” available in Excel 365 and Excel 2021 β€” is a different animal from the ribbon sort. Instead of reordering your existing data in place, it outputs a new sorted version of your range into a separate area of the spreadsheet. The output is dynamic: change the source, the sorted output changes too. Add a row, delete a row, edit a cell β€” the sorted output updates automatically. No button-pressing required. For the full syntax breakdown, see the dedicated Excel SORT function guide.

Basic usage for alphabetical (A-Z) sort:

=SORT(A2:A20)

That's it. Excel 365 spills a sorted copy of your range below (or beside) the formula cell. By default, SORT sorts ascending (A to Z) β€” same as clicking Sort A to Z in the ribbon. To sort Z to A, add a -1 third argument:

=SORT(A2:A20,1,-1)

The second argument (1) tells SORT to sort by the first column of the range. The third (-1) reverses the order to Z-A. For a two-column range where you want to sort by the second column alphabetically:

=SORT(A2:B20,2,1)

This sorts a two-column name/email range alphabetically by column 2 (email), keeping names matched to their emails in the output. The source data stays untouched.

One important caveat: the SORT function's output is read-only. You can't click into the spilled results and edit them directly. Changes go into the source range, not the output. That's actually the point β€” the output is a live view of your data in a different order, not a copy you'd maintain separately.

SORT also combines nicely with FILTER for more powerful queries. For example, =SORT(FILTER(A2:B20,B2:B20>50),1,1) filters rows where column B is over 50, then sorts the filtered results alphabetically by column A. This kind of dynamic filtered-and-sorted output would require manual steps with the ribbon approach every time your data changes.

SORT Function Syntax

=SORT(array, [sort_index], [sort_order], [by_col])

array: range to sort | sort_index: column number to sort by (default 1) | sort_order: 1 = A-Z (default), -1 = Z-A | by_col: FALSE = sort rows (default), TRUE = sort columns

Examples: =SORT(A2:A20) β€” basic A-Z sort | =SORT(A2:B20,2,-1) β€” sort by column 2, Z-A

Case-Sensitive Alphabetical Sort

By default, Excel's alphabetical sort is case-insensitive β€” "apple" and "Apple" sort identically. For most name and text data, that's exactly what you want. But if case matters for your data (product SKUs, system identifiers, anything where "ABC123" and "abc123" are genuinely different values), you can enable case-sensitive sorting:

  1. Go to Data β†’ Sort to open the Sort dialog.
  2. Click Options… in the top-right of the dialog.
  3. Check the Case sensitive box.
  4. Click OK, then set your sort column and order as usual.

With case-sensitive sorting on, Excel treats lowercase and uppercase as different characters. Lowercase letters sort before their uppercase equivalents β€” "apple" before "Apple", "zebra" before "Zebra". This matches standard ASCII ordering where lowercase characters have higher code values than uppercase.

Note: the SORT function doesn't support case-sensitive sorting β€” it's always case-insensitive. For case-sensitive dynamic sorting, you'd need a helper column converting text to comparable values. An edge case most users won't encounter.

Why Your Alphabetical Sort Isn't Working

A few common culprits when sorting produces wrong results or no change at all:

After a sort reshuffles your table, you may need to adjust column widths to fit the new content. Knowing how to change column width in Excel keeps your data readable without manual dragging. And if you need to clean up extra rows after sorting β€” duplicate headers, blank rows that surfaced at the top β€” the keyboard shortcut to delete row in Excel speeds that cleanup considerably.

check

Click any cell inside the column or table you want to sort. You don't need to select the whole column β€” Excel detects the data range automatically.

check

Go to Data tab β†’ Sort A to Z for a quick one-column sort. Or click Sort (the full dialog button) for multi-column or custom sorting.

check

In the Sort dialog, select which column to sort by from the Column dropdown. Make sure 'My data has headers' is checked if your range includes a header row.

check

Set Order to 'A to Z' for alphabetical (ascending) or 'Z to A' for reverse alphabetical (descending).

check

Click 'Add Level' to add a tiebreaker sort. Common use case: sort by Last Name first, then First Name for duplicate last names.

check

Click OK. Excel reorders your data immediately. The sort is applied to the entire table β€” all columns move together.

check

Scroll through the sorted data to confirm it looks right. Check that rows stayed aligned β€” names should still match their corresponding data.

Alt+A+S+A
A-Z Shortcut
Alt+A+S+D
Z-A Shortcut
Excel 365+
SORT Function
64
Max Sort Levels
Optional
Case-Sensitive
SORT only
Auto-Update
Test Your Excel Knowledge

Excel Questions and Answers

How do I sort alphabetically in Excel?

Click any cell in the column you want to sort. Go to the Data tab and click 'Sort A to Z' (the A↓Z button). If your data has multiple columns, Excel will ask whether to expand the selection β€” choose 'Expand the selection' to keep rows together. The entire table is then sorted alphabetically by that column.

What's the keyboard shortcut to sort A to Z in Excel?

The shortcut is Alt+A+S+A β€” press these keys sequentially (not simultaneously). Alt opens the ribbon, A selects the Data tab, S opens the Sort A to Z submenu, and the final A confirms Sort A to Z. For Z to A, use Alt+A+S+D instead.

How do I sort by last name in Excel?

If last names are in their own column, just sort that column A to Z. If you have full names in one column ("Jane Smith"), add a helper column with the formula =MID(A2,FIND(" ",A2)+1,100) to extract just the last name. Then sort by the helper column using Data β†’ Sort A to Z, expanding the selection so the full name column moves with it.

How do I sort multiple columns alphabetically in Excel?

Use the Sort dialog: click any cell in your data, go to Data β†’ Sort, then set your first sort level (e.g., Last Name, A to Z). Click 'Add Level' to add a second criterion (e.g., First Name, A to Z). Excel sorts by the first level, then uses the second level to break ties. You can add up to 64 sort levels.

Why is my alphabetical sort not working correctly?

The most common causes are: (1) numbers stored as text (or text stored as numbers) β€” look for green triangles in cell corners; (2) leading spaces before the text β€” use =TRIM() to remove them; (3) merged cells in the sort range β€” unmerge them first; (4) blank rows within the data β€” Excel treats them as data boundaries and may only sort part of your range.

How do I do a case-sensitive alphabetical sort in Excel?

Open the Sort dialog via Data β†’ Sort. Click the 'Options…' button in the upper right of the dialog. Check the 'Case sensitive' box and click OK. Then set your sort column and A to Z order as normal. With this on, lowercase letters sort before their uppercase equivalents (e.g., 'apple' before 'Apple').

What is the SORT function in Excel?

The SORT function (=SORT(range)) is available in Excel 365 and Excel 2021. It outputs a dynamic sorted copy of your range in a separate area of the spreadsheet. Unlike the ribbon sort, SORT updates automatically when source data changes β€” add a new row to the source and it appears in the correct alphabetical position in the output instantly. Use =SORT(A2:A20) for basic A-Z alphabetical output.

How do I sort an Excel table alphabetically?

If your data is formatted as an Excel Table (Ctrl+T), click the dropdown arrow on the column header you want to sort, then choose 'Sort A to Z'. Excel Tables maintain row integrity automatically β€” every column moves together when you sort. The Table also remembers sort state, so if you want to return to original order, add a numbered index column before sorting.
Practice Excel Questions
β–Ά Start Quiz