How-to recipes · Text
How to capitalize the first letter in Excel
Capitalise the first letter of every word with PROPER, or only the first letter of the text (sentence case) with UPPER, LEFT, LOWER and MID.
Names typed in lower case, product titles in shouting capitals, comments copied from a form with random case: inconsistent capitalisation makes a list look careless and can break sorting and matching in other systems. Excel has three case functions, UPPER, LOWER and PROPER, but none of them produces sentence case, where only the first letter of the text is capital. This recipe shows how to get every common style, and where PROPER gets things wrong.
The example data
Four texts in A2:A5 with different case problems.
Capitalise every word: PROPER
PROPER makes the first letter of each word upper case and all other letters lower case:
| A | B | C | |
|---|---|---|---|
| 1 | Text | ||
| 2 | the invoice is overdue | ||
| 3 | mARIA lOPEZ | Maria Lopez | |
| 4 | 2nd floor, block b | ||
| 5 | PLEASE CALL BACK |
The randomly cased name is fixed in one step.
Result: Maria Lopez
This is the right tool for names, cities and titles. It works in every version, and in Microsoft 365 a single =PROPER(A2:A5) spills the whole column.
Capitalise only the first letter: sentence case
Combine LEFT for the first character with MID for the rest:
| A | B | C | |
|---|---|---|---|
| 1 | Text | ||
| 2 | the invoice is overdue | The invoice is overdue | |
| 3 | mARIA lOPEZ | ||
| 4 | 2nd floor, block b | ||
| 5 | PLEASE CALL BACK |
The first character is made upper case and everything else lower case.
Result: The invoice is overdue
LEFT(A2,1)takes the first character and UPPER capitalises it.MID(A2,2,LEN(A2))takes everything from the second character to the end; using the full length as the count is a safe way to say the rest.- LOWER makes the rest lower case, and
&joins the two parts.
Applied to PLEASE CALL BACK the same formula gives Please call back. If the rest of the text has intentional capitals that you want to keep, such as names or abbreviations, leave out LOWER: =UPPER(LEFT(A2,1))&MID(A2,2,LEN(A2)) changes only the first letter.
Microsoft 365: the whole column at once
| A | B | C | |
|---|---|---|---|
| 1 | Text | ||
| 2 | the invoice is overdue | The invoice is overdue | |
| 3 | mARIA lOPEZ | Maria lopez | |
| 4 | 2nd floor, block b | 2nd floor, block b | |
| 5 | PLEASE CALL BACK | Please call back |
One formula, four results. Note that sentence case turns the name into Maria lopez, so use PROPER for names.
Another way to write the same thing uses REPLACE to swap only the first character: =REPLACE(LOWER(A2),1,1,UPPER(LEFT(A2,1))). Choose whichever you find easier to read.
Leading spaces break it
If the text starts with a space, LEFT returns the space and the first letter stays small. Wrap the source in TRIM: =UPPER(LEFT(TRIM(A2),1))&LOWER(MID(TRIM(A2),2,LEN(A2))). See How to remove spaces in Excel.
Without formulas: Flash Fill
Type the corrected version of the first text in the next column, select the cell below and press Ctrl+E. Flash Fill learns the capitalisation pattern from your example. It handles simple cases well, but check a few rows, especially those with numbers or names.
Replacing the original text
All formulas create a corrected copy. To overwrite the original column: copy the formula results, select the original cells, and choose Home > Paste > Values. Then delete the helper column. Excel has no Change Case button like Word; if you need that often, a short macro can loop over the selection and apply StrConv(cell.Value, vbProperCase), which is explained in Working with text (strings) in VBA.
Pitfalls
- Names with particles (van, de, von) should often stay lower case: PROPER makes them Van and De. Fix them afterwards with SUBSTITUTE, for example
=SUBSTITUTE(PROPER(A2)," Van "," van "). - Abbreviations such as VAT, USA or IBAN become Vat, Usa, Iban with PROPER and vat with sentence case. Keep a short list of exceptions to fix.
- Sentence case is per cell, not per sentence. A cell with two sentences only gets the first one capitalised.
- Languages. UPPER and LOWER handle accented letters correctly (é to É), but locale-specific rules, like the Turkish dotted I, are not applied.