Excel Practice Test

โ–ถ

Learning how to sort by last name in Excel is one of those deceptively tricky skills that trips up even experienced spreadsheet users. The challenge is simple to state but harder to solve: most contact lists, employee rosters, and member directories store full names in a single cell, like "Jennifer Martinez" or "Dr. Robert Chen Jr." Excel has no built-in awareness that the second word is the family name, so a basic sort just alphabetizes by first name and leaves you with a useless list.

The good news is that there are at least five reliable methods to solve this problem, ranging from a thirty-second Text to Columns shortcut to elegant formulas that update automatically as new names are added. Whether you are organizing a 50-person team roster or a 50,000-row customer database, the right approach depends on how clean your data is, whether names include middle initials or suffixes, and whether you need the sort to update dynamically when new entries arrive.

This guide walks through every method professionals use in 2026, from the simple Text to Columns wizard that splits "First Last" into two separate columns, to RIGHT and FIND formula combinations that extract surnames without modifying source data, to Flash Fill which learned its tricks alongside features like remove duplicates excel and how to merge cells in excel. We will also cover Power Query for recurring imports and how to handle edge cases like hyphenated names, multi-word surnames such as "Van Der Berg," and titles like "Ph.D." that throw off naive splitting logic.

Beyond the mechanics, you will learn the strategic question of when to split names permanently versus when to sort temporarily using a helper column. Permanent splits are great for databases and pivot reports, but helper columns preserve original formatting for mail merges and printed directories. Each approach has trade-offs around speed, accuracy, and maintainability that we will examine in detail with screenshots, formula breakdowns, and real-world examples drawn from HR, sales, education, and nonprofit data sets.

By the end, you will have a decision framework: given any messy name list, you will know which method to reach for first, how to validate the result, and how to recover gracefully when the data contains the inevitable oddities that real-world spreadsheets always seem to include. You will also pick up adjacent skills like sorting by multiple columns, filtering by surname initial, and creating dropdown-driven sort tools for shared workbooks.

The techniques here work in Excel 2016, 2019, 2021, Excel for Microsoft 365, and Excel for the Web, with notes where behavior differs. Most also translate directly to Google Sheets and LibreOffice Calc with minor syntax adjustments. Let us start with the core methods and work toward the more advanced patterns most analysts never learn but quietly rely on every week.

Sorting Names in Excel by the Numbers

โฑ๏ธ
30 sec
Text to Columns time
๐Ÿ“Š
5
Reliable methods
โœ…
98%
Flash Fill accuracy
๐Ÿ”ข
1M+
Rows Excel can sort
๐ŸŽฏ
2 clicks
Sort after splitting
Test Your Skills: How to Sort by Last Name in Excel Quiz

Five Methods to Sort by Last Name

โœ‚๏ธ

The fastest method for a one-time sort. Highlight your name column, use Data โ†’ Text to Columns with a space delimiter, and Excel splits first and last names into separate cells you can sort directly.

๐Ÿงฎ

Best when you need a non-destructive helper column. The formula =RIGHT(A2,LEN(A2)-FIND(" ",A2)) extracts the last name from "First Last" without modifying the original cell, perfect for dynamic lists.

โšก

Available in Excel 2013+. Type two example last names in the adjacent column, then press Ctrl+E. Excel recognizes the pattern and fills the rest, handling most common name formats automatically without any formula.

๐Ÿ”„

Ideal for recurring imports. Build a query that splits names on the rightmost space, sorts by the surname column, and refreshes with one click whenever the source data updates. Great for monthly reports.

๐Ÿ†•

New in Microsoft 365 and Excel 2024. Use =INDEX(TEXTSPLIT(A2," "),COUNTA(TEXTSPLIT(A2," "))) to grab the last token of any name, gracefully handling middle initials and multi-part first names.

The Text to Columns wizard is the workhorse method that most professionals reach for first, and for good reason: it is fast, visual, and handles the standard "First Last" format flawlessly. To begin, select the column containing your full names. If your column has a header like "Name," include it but be aware that the header text will also be split. Next, navigate to the Data tab on the ribbon and click Text to Columns in the Data Tools group. The Convert Text to Columns Wizard opens with three steps.

In step one, choose Delimited rather than Fixed Width because names are separated by spaces of varying widths between entries. Click Next. In step two, uncheck Tab and check Space as your delimiter. The preview window at the bottom shows how your data will be split. If you see your names breaking into two clean columns labeled First and Last, you are in good shape. If you see three or four columns because some names include middle initials, you will need to adjust your strategy, which we cover in the troubleshooting section. Click Next.

Step three lets you set the data format for each new column. For names, General is fine, but if any of your names happen to look like dates or numbers (rare, but possible with surnames like "May" or "June"), set the column type to Text to prevent unwanted conversion. The most important setting on this screen is the Destination field. By default it overwrites column A, but you should change it to point at an empty column like C1 so the original data is preserved. Click Finish.

You now have first names in one column and last names in another. To sort, click any cell in your data range, go to Data โ†’ Sort, and in the Sort dialog choose your Last Name column under "Sort by," with order set to A to Z. Critically, make sure the "My data has headers" box matches your sheet, otherwise your header row will be sorted along with the data. Click OK and your entire row block reorders by surname, keeping email addresses, phone numbers, and other associated data correctly aligned with each person.

For lists where you do not want to permanently alter the original Name column, copy your name column to a scratch area first, run Text to Columns on the copy, then use the resulting Last Name column as a helper for sorting. After sorting, you can delete the helper columns and the main data remains in the new surname order. This preserves the original "First Last" formatting in your primary column while still achieving the sort you wanted.

One subtle gotcha: Text to Columns operates on the column to the right of your selection if those cells contain data. Excel will prompt you with a warning, but it is easy to click through and accidentally overwrite something important. Always verify there are at least two empty columns immediately to the right of your selection, or set an explicit destination cell far from your existing data. This small habit saves the painful rediscovery of lost columns three days later when someone asks where the phone numbers went.

The Text to Columns approach pairs naturally with techniques like how to freeze a row in excel so your header stays visible during the sort, and it works well alongside how to create a drop down list in excel when you want to build sort selectors for non-technical teammates. Combined, these features turn a static name list into an interactive directory.

Microsoft Excel Practice Test Questions

Prepare for the Microsoft Excel exam with our free practice test modules. Each quiz covers key topics to help you pass on your first try.

Microsoft Excel Excel Basic and Advance
Microsoft Excel Exam Questions covering Excel Basic and Advance. Master Microsoft Excel Test concepts for certification prep.
Microsoft Excel Excel Formulas
Free Microsoft Excel Practice Test featuring Excel Formulas. Improve your Microsoft Excel Exam score with mock test prep.
Microsoft Excel Excel Functions
Microsoft Excel Mock Exam on Excel Functions. Microsoft Excel Study Guide questions to pass on your first try.
Microsoft Excel Excel MCQ
Microsoft Excel Test Prep for Excel MCQ. Practice Microsoft Excel Quiz questions and boost your score.
Microsoft Excel Excel
Microsoft Excel Questions and Answers on Excel. Free Microsoft Excel practice for exam readiness.
Microsoft Excel Excel Trivia
Microsoft Excel Mock Test covering Excel Trivia. Online Microsoft Excel Test practice with instant feedback.
Microsoft Excel Advanced Data Analysis Tools
Free Microsoft Excel Quiz on Advanced Data Analysis Tools. Microsoft Excel Exam prep questions with detailed explanations.
Microsoft Excel Advanced Formula and Macro...
Microsoft Excel Practice Questions for Advanced Formula and Macro Creation. Build confidence for your Microsoft Excel certification exam.
Microsoft Excel Advanced Formulas and Macros
Microsoft Excel Test Online for Advanced Formulas and Macros. Free practice with instant results and feedback.
Microsoft Excel Basic and Advance Question...
Microsoft Excel Study Material on Basic and Advance Questions and Answers. Prepare effectively with real exam-style questions.
Microsoft Excel Creating and Managing Charts
Free Microsoft Excel Test covering Creating and Managing Charts. Practice and track your Microsoft Excel exam readiness.
Microsoft Excel Data Visualization with Ch...
Microsoft Excel Exam Questions covering Data Visualization with Charts. Master Microsoft Excel Test concepts for certification prep.
Microsoft Excel Formulas and Functions
Free Microsoft Excel Practice Test featuring Formulas and Functions. Improve your Microsoft Excel Exam score with mock test prep.
Microsoft Excel Formulas and Functions App...
Microsoft Excel Mock Exam on Formulas and Functions Application. Microsoft Excel Study Guide questions to pass on your first try.
Microsoft Excel Formulas Questions and Ans...
Microsoft Excel Test Prep for Formulas Questions and Answers. Practice Microsoft Excel Quiz questions and boost your score.
Microsoft Excel Functions Questions and An...
Microsoft Excel Questions and Answers on Functions Questions and Answers. Free Microsoft Excel practice for exam readiness.
Microsoft Excel Managing Data Cells and Ra...
Microsoft Excel Mock Test covering Managing Data Cells and Ranges. Online Microsoft Excel Test practice with instant feedback.
Microsoft Excel Managing Tables and Data
Free Microsoft Excel Quiz on Managing Tables and Data. Microsoft Excel Exam prep questions with detailed explanations.
Microsoft Excel Managing Tables and Table ...
Microsoft Excel Practice Questions for Managing Tables and Table Data. Build confidence for your Microsoft Excel certification exam.
Microsoft Excel Managing Worksheets and Wo...
Microsoft Excel Test Online for Managing Worksheets and Workbooks. Free practice with instant results and feedback.
Microsoft Excel MCQ Questions and Answers
Microsoft Excel Study Material on MCQ Questions and Answers. Prepare effectively with real exam-style questions.
Microsoft Excel Questions and Answers
Free Microsoft Excel Test covering Questions and Answers. Practice and track your Microsoft Excel exam readiness.
Microsoft Excel Trivia Questions and Answers
Microsoft Excel Exam Questions covering Trivia Questions and Answers. Master Microsoft Excel Test concepts for certification prep.
Microsoft Excel Workbook and Worksheet Man...
Free Microsoft Excel Practice Test featuring Workbook and Worksheet Management. Improve your Microsoft Excel Exam score with mock test prep.

Formula Methods That Beat vlookup excel Complexity

๐Ÿ“‹ RIGHT + FIND

The classic formula for extracting a last name from "First Last" is =RIGHT(A2,LEN(A2)-FIND(" ",A2)). It works by finding the position of the first space, calculating how many characters come after it, and returning that many characters from the right side of the string. This handles two-word names perfectly and runs faster than vlookup excel because it only touches one cell.

To use it, place the formula in column B next to your name column, then copy it down. The resulting last names are live values that update if the source changes. Sort by column B and your full names rearrange accordingly. The limitation is middle names: "Mary Ann Smith" returns "Ann Smith" because the first space breaks before "Ann." For lists with middle names, use the TRIM and SUBSTITUTE pattern shown in the next tab.

๐Ÿ“‹ TRIM + SUBSTITUTE

For names with middle initials or middle names, the formula =TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100)) is the gold standard. It replaces every space with 100 spaces, grabs the rightmost 100 characters, then trims excess whitespace. The result is always the final word in the cell, regardless of how many middle parts exist.

This handles "John F Kennedy" returning "Kennedy," "Mary Ann Smith" returning "Smith," and even "Josรฉ de la Cruz" returning "Cruz." The downside is that for compound surnames like "de la Cruz," it only captures the final token. For Hispanic, Dutch, or hyphenated surnames you may need manual review or a custom split rule based on a recognized particle list.

๐Ÿ“‹ TEXTSPLIT (M365)

Microsoft 365 users have the cleaner TEXTSPLIT function. Use =INDEX(TEXTSPLIT(A2," "),COUNTA(TEXTSPLIT(A2," "))) to extract the last token of any name. TEXTSPLIT returns an array of name parts, COUNTA counts them, and INDEX grabs the final element. The syntax is more readable than the SUBSTITUTE workaround and behaves identically on multi-word names.

You can also use the LET function to make this even more elegant: =LET(parts, TEXTSPLIT(A2," "), INDEX(parts, COUNTA(parts))). This names the intermediate result for clarity and runs slightly faster on large lists because TEXTSPLIT only executes once. It is the future-proof approach as more workbooks migrate to modern Excel.

Splitting vs. Helper Columns: Which Approach Wins?

Pros

  • Permanent splits create cleaner data for future pivot tables and reports
  • First and last name columns enable mail merges and personalized greetings
  • Sorting becomes a one-click action with no formulas to maintain
  • Filtering by surname initial is dramatically easier with split columns
  • Power Query and Power Pivot work better with normalized name fields
  • Database imports usually expect separate first and last name columns
  • Audit trails are clearer when each column has a single semantic meaning

Cons

  • Original "First Last" format is lost unless you also keep a combined column
  • Re-joining for display requires a CONCAT formula in another column
  • Edge cases like "Van Der Berg" or "Mary Ann" need manual cleanup
  • Suffixes like Jr., Sr., III may end up in the wrong column
  • Some downstream systems expect a single full name field
  • Cultural naming conventions (Hispanic, Asian) often break simple split rules

Pre-Sort Checklist Before You Touch the Sort Button

Make a backup copy of your worksheet before any destructive operation
Confirm your data range is contiguous with no fully empty rows or columns
Verify the header row matches Excel's expectations (Data has headers checked)
Scan for trailing spaces using TRIM or Find and Replace before splitting
Identify any names with middle initials, suffixes, or compound surnames
Decide whether to overwrite the original Name column or create helpers
Ensure there are empty columns to the right of your data for splits
Convert any text-formatted dates or numbers to General if needed
Unmerge any merged cells in the sort range to prevent sort errors
Document your chosen method in a notes cell for reproducibility
Always Sort by Two Columns

When sorting by last name, add a second sort level for first name. This ensures that two people named "Smith" appear in predictable order: Alice Smith before Bob Smith. In the Sort dialog, click Add Level after setting Last Name as the primary sort, then choose First Name as the secondary sort. This small habit prevents subtle ordering bugs in reports.

Flash Fill is the fastest method most users never try, and it deserves more attention because it handles formats that formulas struggle with. Introduced in Excel 2013 and refined every year since, Flash Fill watches what you type in a column and offers to complete the pattern. To extract last names with Flash Fill, click the cell immediately to the right of your first name and type the surname manually. Move down one cell and type the surname of the second person. By the time you start typing the third, Excel usually previews the entire column in gray.

Press Ctrl+E or hit Enter on the suggestion and Excel fills the remaining cells. The magic is that Flash Fill recognizes patterns beyond simple splitting: it can pull last names from "Lastname, Firstname" format, ignore titles like Dr. or Mr., handle middle initials, and even capitalize correctly if your source data is mixed case. The accuracy on consistent data approaches 98 percent, but always spot-check the results because Flash Fill occasionally guesses wrong on ambiguous patterns.

For recurring tasks where the same name list refreshes monthly, Power Query is the superior tool. Go to Data โ†’ Get Data โ†’ From Other Sources โ†’ Blank Query, or import your file through Get Data. In the Power Query Editor, select your name column, choose Split Column โ†’ By Delimiter โ†’ Space โ†’ Right-most delimiter. This always splits on the last space, correctly handling middle names. Rename the resulting columns, then sort by the surname column using the column header dropdown.

The power of this approach is in the Refresh button. Once your query is built, every time the source file updates, you click Data โ†’ Refresh All and your sorted, split output regenerates instantly. For HR teams that receive new employee rosters every month or sales teams pulling fresh CRM exports, this turns a 15-minute repetitive task into a single click. Power Query also handles edge cases more gracefully than worksheet formulas because you can build conditional logic for suffixes like Jr. and Sr.

Combining these tools creates compound workflows. You might use Power Query to import and split names, Flash Fill to clean up titles, and worksheet formulas for live re-sorting based on user input. This layered approach is the hallmark of professional Excel work and contrasts with the brittle one-off Text to Columns approach that breaks the moment your data shape changes.

For shared workbooks, consider adding a sort macro. Open the Visual Basic Editor with Alt+F11, insert a new module, and paste a Sub that calls Range("A2:E100").Sort Key1:=Range("B2"), Order1:=xlAscending. Assign the macro to a button on your sheet and colleagues can re-sort with one click. This is especially valuable when the workbook is used by non-Excel-experts who would otherwise risk breaking the sort by accidentally selecting only one column.

Modern Excel also supports the SORT and SORTBY dynamic array functions. =SORTBY(A2:C100, B2:B100) returns the entire range sorted by the values in column B, recalculating automatically when the source changes. This is the cleanest solution for dashboards and reports where the underlying data is volatile. Pair it with the FILTER function to create searchable, sorted name lists driven by a single input cell.

Edge cases are where last-name sorting earns its reputation as a deceptively tricky problem. The most common is the multi-word surname: "Van Der Berg," "de la Cruz," "O'Brien-Smith." A naive RIGHT and FIND formula returns only "Berg," "Cruz," or "Smith," hiding the cultural particle that may be sortable as part of the surname depending on convention. The fix depends on your audience. American sort conventions often ignore particles ("Van Der Berg" sorts under B), while European conventions sort by the full surname (under V).

For lists with mixed conventions, build a lookup table of recognized particles and a custom formula that conditionally includes them. Alternatively, add a manual "Surname for Sorting" column where edge cases can be hand-corrected. This is more work upfront but produces predictable results that match user expectations. Tools like remove duplicates excel pair well here because cleaning the list before sorting prevents one person from appearing under both "Van Der Berg" and "Vanderberg" due to inconsistent data entry.

Suffixes are the next stumbling block. Names like "John Smith Jr." or "Mary Johnson III" break the "last word is the surname" assumption. The TRIM and RIGHT formula returns "Jr." or "III" instead of the actual surname. The simplest fix is a list of suffixes and a nested IF that returns the second-to-last word when the last word matches. A cleaner approach uses Power Query with a custom function that strips suffixes before splitting.

Honorifics and titles at the start of names create the mirror problem. "Dr. Robert Chen" or "Mrs. Patricia Davis" may pull the title into the first-name column. Flash Fill handles this well if you give it two or three corrected examples, recognizing the pattern and stripping titles automatically. For programmatic handling, a SUBSTITUTE chain that removes common titles before splitting is reliable. Maintain the title list in a named range so it can be updated centrally.

Comma-separated formats like "Smith, John" require a different strategy entirely. Here the surname comes first and you actually want to sort the column as-is, then optionally split into two columns by the comma delimiter. Text to Columns with comma as the delimiter handles this perfectly. If you receive lists in mixed formats (some "First Last," some "Last, First"), use a formula that detects the comma with ISNUMBER(SEARCH(",", A2)) and applies different extraction logic to each row.

Hyphenated surnames like "Garcia-Lopez" are usually unproblematic because the hyphen has no special meaning in Excel and the full hyphenated surname is treated as a single token. They sort under G as expected. The exception is when the data entry used a space instead of a hyphen, creating "Garcia Lopez" which the formula treats as middle name plus surname. A pre-processing pass that converts " " to "-" for known compound surnames solves this, though it requires building or buying a reference list.

Finally, watch for invisible characters. Names imported from web forms or PDFs often contain non-breaking spaces (character 160) instead of regular spaces (character 32). Your formulas will return the entire string because FIND(" ", A2) finds nothing. The fix is to wrap your input in =SUBSTITUTE(A2, CHAR(160), CHAR(32)) before extraction. This small detail explains many "my formula isn't working" frustrations and is worth checking first whenever results look wrong.

Master Excel Formulas: Take the Free Practice Test Now

Putting it all together, here is the practical decision tree most analysts settle into after a few years of working with name data. For a one-time sort of clean data where you do not care about preserving the original format, use Text to Columns. It takes 30 seconds, requires no formulas, and produces immediately usable results. The vast majority of last-name sorting needs fall into this bucket and reaching for anything more sophisticated is over-engineering.

For lists you will sort repeatedly or where the underlying data changes, build a helper column with the TRIM and SUBSTITUTE formula. The formula is reusable, handles middle names, and updates automatically when source data changes. Hide the helper column once you have set up the sort, or place it off to the right where it does not distract from the main view. This pattern scales well from 100 rows to 100,000 with no performance issues.

For monthly or quarterly reports built from imported data, invest 30 minutes in a Power Query. The upfront cost is real, but every subsequent refresh takes one click. After three months you have saved hours, after a year you have saved a workweek. Power Query also documents your logic in a way that the next person to inherit your workbook can read and modify, which is more than can be said for nested worksheet formulas.

For dashboards and interactive reports, use the modern dynamic array functions: SORT, SORTBY, TEXTSPLIT, and FILTER. These produce live, recalculating output without helper columns and feel native to how modern Excel works. They require Microsoft 365 or Excel 2021+, so confirm your audience has compatible versions before committing. Backwards compatibility with Excel 2019 and earlier requires the older formula patterns.

Whatever method you choose, validate your results by spot-checking 10 random rows and the first and last entries of the sorted list. Look specifically for rows where the surname extraction may have gone wrong: anyone with a middle name, anyone with a suffix, anyone with a non-Western name structure. A five-minute validation prevents the embarrassment of distributing a sorted directory where half the executives are filed under their middle names.

Document your approach in a comment cell or a separate Notes tab. Future-you and your colleagues will appreciate knowing whether the Last Name column is a formula, a Flash Fill result, or a Power Query output. This becomes critical when someone asks to add new names and the answer depends entirely on which method you used. A simple "// Last Name column auto-populated by formula in B2; do not edit manually" comment prevents hours of confusion.

Finally, treat name sorting as part of a broader data hygiene practice. Combine it with deduplication, consistent capitalization, trimmed whitespace, and standardized formatting. A clean, sorted name list is the foundation for mail merges, pivot tables, and reporting. The 20 minutes you spend cleaning and sorting now save hours of cleanup later when someone notices that "john smith" and "John Smith" are counted as two different customers.

Excel Questions and Answers

How do I sort by last name in Excel when names are in one column?

The fastest way is Text to Columns: select your name column, go to Data โ†’ Text to Columns, choose Delimited, select Space as the delimiter, and set a destination cell. This splits names into first and last name columns. Then select your data, click Sort, choose the Last Name column, and pick A to Z order. Your entire row block reorders by surname while keeping related data aligned.

What formula extracts the last name from a full name in Excel?

Use =TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100)) for any name format. It substitutes spaces with 100 spaces, grabs the rightmost 100 characters, then trims excess whitespace, always returning the final word. For simple two-word names, the shorter =RIGHT(A2,LEN(A2)-FIND(" ",A2)) also works. Microsoft 365 users can use =INDEX(TEXTSPLIT(A2," "),COUNTA(TEXTSPLIT(A2," "))) for the cleanest modern syntax.

Can Flash Fill extract last names automatically?

Yes, Flash Fill is excellent for this task. Type the surname of the first person in the column next to the full name, then start typing the surname of the second person. Excel usually previews the entire pattern in gray. Press Ctrl+E to accept the suggestion and fill the column. Flash Fill handles middle initials, titles, and many edge cases that simple formulas miss, with about 98 percent accuracy on consistent data.

How do I sort by last name when names are formatted as Last, First?

If names are already in Last, First format, you can sort the column as-is since the surname appears first. If you want to split them, use Text to Columns with comma as the delimiter, then optionally also split on space to separate first and middle names. For mixed formats, use a formula like =IF(ISNUMBER(SEARCH(",",A2)), LEFT(A2,FIND(",",A2)-1), RIGHT(...)) to detect and extract appropriately.

How do I handle middle names when sorting by last name?

The TRIM and SUBSTITUTE formula =TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100)) handles middle names correctly because it always returns the final word, regardless of how many parts the name has. Simple FIND-based formulas fail because they split on the first space. For TEXTSPLIT users in Microsoft 365, the INDEX and COUNTA combination also handles middle names natively without any workaround.

Why does Excel sort only one column instead of the whole row?

This happens when you select only the cells in one column before sorting. Excel sometimes prompts you to expand the selection, but if you click Continue with current selection, it sorts that column in isolation and breaks the relationship between rows. Always click a single cell within your data and let Excel auto-detect the range, or use the Sort dialog with explicit range selection covering all related columns.

How do I sort by last name in Excel without splitting the column?

Create a helper column with the formula =TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),100)) next to your name column. Copy it down. Then sort your data using the helper column as the sort key while keeping the original Name column intact. After sorting, you can hide or delete the helper column. The visible Name column remains in original First Last format but is now ordered by surname.

What if my names have suffixes like Jr. or III?

Suffixes break standard formulas because the last word becomes Jr. or III instead of the surname. Use Flash Fill, which learns from corrected examples and handles suffixes well. Alternatively, build a SUBSTITUTE chain that removes common suffixes before extraction: =TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(A2," Jr.","")," III",""),...)). For repeating workflows, Power Query with a custom suffix-stripping function is the most maintainable approach.

Can I sort by last name in Excel for the Web?

Yes, all the core methods work in Excel for the Web. Text to Columns, basic sorting via Data โ†’ Sort, formulas including TRIM, RIGHT, and SUBSTITUTE, and Flash Fill (Ctrl+E) all function identically. Power Query has limited support in the web version, so for complex import-and-sort workflows, use desktop Excel. Modern dynamic array functions like SORT and TEXTSPLIT work in the web version with a Microsoft 365 subscription.

How do I keep my sort updated as new names are added?

Use the SORTBY dynamic array function: =SORTBY(A2:C1000, helper_column_range). This returns a live sorted copy that updates automatically when source data changes. Alternatively, format your data as an Excel Table (Ctrl+T), then any sort applied persists and can be reapplied to new rows. For the most automation, build a Power Query that splits and sorts on refresh, then place the output on a separate sheet that users see.
โ–ถ Start Quiz