Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Capitalize Last Name in Excel: Step-by-Step

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To capitalize a last name in Excel, use the PROPER function: if the last name is in cell A2, enter =PROPER(A2) in a blank cell, press Enter, and copy the result back as values if you want to replace the original. For a full name in one cell, use a formula that isolates the last word first, such as =PROPER(TRIM(RIGHT(SUBSTITUTE(TRIM(A2)," ",REPT(" ",100)),100))). This works in Excel for Microsoft 365, Excel 2021, 2019, 2016, and most earlier desktop versions; the exact ribbon labels can differ slightly by version, device, and region.

What You'll Need

  • Excel desktop (Windows or Mac) or Excel for the web. The formulas below work in all of them.
  • Your data in a column, with one name per cell. A header row is helpful but not required.
  • A blank column to the right of your data for the formula results.
  • Optional: a helper column if you want to split first and last names before capitalizing.

Step-by-Step

  1. Make a backup copy of the sheet. Select the sheet tab, right-click, and choose Move or Copy > Create a copy. Formulas overwrite data if you paste them over the original, so a copy is your safety net.
  2. Identify where the last name lives. If last names are already in their own column (for example column B), go to step 3. If first and last names are together in one column (for example column A), skip to step 6.
  3. Enter the PROPER formula next to the first last name. Click the first empty cell in a new column, type =PROPER(B2) (replace B2 with your actual cell), and press Enter. PROPER capitalizes the first letter of each word and lowercases the rest, so "SMITH" becomes "Smith" and "o'brien" becomes "O'Brien".
  4. Fill the formula down. Select the cell with the formula, hover over the small square at its bottom-right corner until the cursor becomes a plus sign, and double-click or drag down to the last row of data. Every row now shows a properly capitalized last name.
  5. Convert formulas to values. Select the new column, press Ctrl+C (Cmd+C on Mac), then right-click the same range and choose Paste Special > Values. This removes the formulas so the text stays put if you delete the original column. On Excel for the web, use Ctrl+Shift+V or right-click > Paste Special > Values.
  6. Handle full names in one cell. If column A contains "john smith" and you want only "Smith" capitalized, use a formula that extracts the last word. In a blank cell, enter =PROPER(TRIM(RIGHT(SUBSTITUTE(TRIM(A2)," ",REPT(" ",100)),100))). This replaces each space with 100 spaces, takes the last 100 characters, and trims back to the final word. It handles middle names and suffixes like "Jr." as the last word, so check those rows.
  7. Split names first if you prefer simpler formulas. Select the full-name column, go to Data > Text to Columns, choose Delimited, tick Space, and finish. First names land in one column and last names in the next, and you can then apply =PROPER() to the last-name column alone. This is cleaner when names contain middle initials or two-word surnames.
  8. Replace the original data. Once the new column looks correct, copy it, paste it over the original last-name column using Paste Special > Values, and delete the helper column. Check a few rows before deleting anything.

Common Mistakes

  • Using UPPER instead of PROPER. =UPPER() makes every letter capital (SMITH), which is not what most people want for a name. PROPER gives Smith.
  • Forgetting to paste as values. If you delete the original column while the new column still contains formulas, you get #REF! errors. Convert to values first.
  • Assuming PROPER fixes everything. It lowercases the rest of each word, so "McDonald" becomes "Mcdonald" and "de la Cruz" becomes "De La Cruz". Fix these manually after the formula runs.
  • Leaving extra spaces. A trailing space makes PROPER produce "Smith " with a stray space, which breaks lookups. Wrap the formula in TRIM: =PROPER(TRIM(B2)).
  • Applying the formula to the wrong column. Double-check that the cell reference points to the last-name column, not the first-name column.

Tips

  • Use =PROPER(TRIM(CLEAN(B2))) to strip extra spaces and non-printing characters in one go.
  • To capitalize only the first letter and force the rest lowercase without affecting other words, combine =UPPER(LEFT(B2,1))&LOWER(MID(B2,2,LEN(B2)-1)). This is useful for single-word last names.
  • Flash Fill can handle simple patterns: type the correctly capitalized name in the cell next to the first row, then press Ctrl+E (Cmd+E on Mac). Review the results, because Flash Fill guesses from examples and can misread unusual names.
  • Keep a helper column until you have checked every row. Names with apostrophes, hyphens, and particles (van, von, de) are the usual trouble spots.
  • If you work with Excel Tables (Insert > Table), formulas fill down automatically when you add rows.

Troubleshooting

  • The formula shows as text. The cell is formatted as Text. Select it, go to Home > Number Format, choose General, then re-enter the formula and press Enter.
  • You see #NAME?. The function name is misspelled or the formula is missing a parenthesis. Retype =PROPER(B2) exactly.
  • You see #VALUE!. The referenced cell contains an error or a number. Check the source cell.
  • Results look right but sorting breaks. The new column is still formulas pointing at deleted data. Paste as values again.
  • Some names are still wrong. PROPER cannot know that "MacLeod" or "O'CONNOR" should keep internal capitals. Correct those cells manually.
  • The last-word formula returns the whole name. The cell likely contains non-breaking spaces. Use =PROPER(TRIM(SUBSTITUTE(A2,CHAR(160)," "))) first, then apply the extraction formula.

Frequently Asked Questions

Can I capitalize a last name without a formula?

Yes. Type the corrected name in the cell beside the first row and press Ctrl+E (Flash Fill). It works well for consistent patterns but should be checked row by row.

Does PROPER work on names with hyphens and apostrophes?

It capitalizes the letter after a hyphen or apostrophe in most cases, so "smith-jones" becomes "Smith-Jones". Always spot-check unusual names.

How do I capitalize only the last name when the full name is in one cell?

Use the RIGHT/SUBSTITUTE/REPT formula in step 6, or split the names with Data > Text to Columns and apply PROPER to the last-name column.

Will this change my original data?

No. Formulas in a separate column leave the source untouched until you copy the results and paste them back as values.

Why does PROPER lowercase the rest of the name?

That is how the function is designed: first letter of each word uppercase, all other letters lowercase. Fix intentional internal capitals manually.

Does this work in Excel for the web and on Mac?

Yes. PROPER, TRIM, SUBSTITUTE, and Paste Special > Values are available in Excel for the web, Excel for Mac, and Excel for Windows, though menu labels can differ slightly.