Capitalizing the First Letter of Sentences in a Cell

Written by Allen Wyatt (last updated July 18, 2026)

5

Ginny notes that in Word, she can easily make sure that sentences start with a capital letter. She cannot find a way to do the same thing in Excel. She wonders if there is a way to make sure that only the first letter of each sentence in a cell is capitalized.

Like so many things in Excel, the answer to Ginny's query depends on the nature of the data. For instance, if the cells contain only a single sentence, then you can use either of the following formulas:

=UPPER(LEFT(A1, 1)) & LOWER(RIGHT(A1, LEN(A1) - 1))
=REPLACE(LOWER(A1), 1, 1, UPPER(LEFT(A1, 1)))

The result of either formula is that the first letter in the cell is converted to uppercase and everything else in the cell is forced to lowercase.

If your data, however, can have multiple sentences per cell, then this approach isn't that great. Instead, you need a formula that is more complex. The following will work as long as you are using Excel 2024 or later:

=LET(t, TRIM(TEXTSPLIT(A1, {".","!","?"}, , TRUE)),
s, SCAN(-1, LEN(t), LAMBDA(a,v,a+v+2)),
p, MID(TRIM(A1), s, 2),
r, REPLACE(LOWER(t), 1, 1, UPPER(LEFT(t, 1))) & p,
CONCAT(r))

Even though I've shown this formula using multiple lines, it is a single formula and should be entered as such. If you are using Microsoft 365, then you can also use a formula based on the new RexEx functions:

=REGEXREPLACE(LOWER(A1), "(^|[.!?]\s+)([a-z])", "$1\u$2")

None of these help you, though, if you are using a version of Excel before Excel 2024. In that case, you'll want to use a macro.

Sub SentenceCaseSelection()
    Dim c As Range
    Dim sText As String
    Dim i As Long
    Dim capitalizeNext As Boolean
    Dim currentChar As String

    For Each c In Selection.Cells
        If Not c.HasFormula And VarType(c.Value) = vbString Then
            sText = Application.Trim(c.Value)

            If Len(sText) > 0 Then
                capitalizeNext = True

                For i = 1 To Len(sText)
                    currentChar = Mid(sText, i, 1)

                    If capitalizeNext Then
                        If currentChar Like "[A-Za-z]" Then
                            Mid(sText, i, 1) = UCase(currentChar)
                            capitalizeNext = False

                        ElseIf currentChar <> " " _
                          And currentChar <> vbTab _
                          And currentChar <> vbCr _
                          And currentChar <> vbLf _
                          And currentChar <> """" _
                          And currentChar <> "'" _
                          And currentChar <> ")" _
                          And currentChar <> "]" _
                          And currentChar <> "}" Then
                            capitalizeNext = False
                        End If
                    End If
                    If currentChar = "." Or _
                      currentChar = "?" Or _
                      currentChar = "!" Then
                        capitalizeNext = True
                    End If
                Next i

                c.Value = sText
            End If
        End If
    Next c
End Sub

This macro works on whatever cells you have selected. It looks for any sentence-terminating character (period, question mark, or exclamation mark) and, if it is followed by a space, capitalizes the letter following the space.

There is one more thing that should be mentioned in closing: By default, Excel should automatically capitalize the first letter of each sentence as you type. If it does not, then you should follow these steps:

  1. Display the Excel Options dialog box. (In Excel 2007 click the Office button and then click Excel Options. In Excel 2010 or a later version, display the File tab of the ribbon and then click Options.)
  2. At the left side of the dialog box click Proofing.
  3. Click AutoCorrect Options. Excel displays the AutoCorrect dialog box. (See Figure 1.)
  4. Figure 1. The AutoCorrect dialog box.

  5. Make sure the Capitalize First Letter of Sentences check box is selected.
  6. Click OK.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (13987) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, 2021, 2024, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Removing Hyperlinks without a Macro

If you have a whole slew of hyperlinks in a worksheet and you want to get rid of them, it's easier than you think. This ...

Discover More

Requiring Input

If you distribute a workbook that is used by others for data entry, you may want a way to make sure they fill in certain ...

Discover More

Making Sure Numbers Copy as Numbers

When you copy information from one worksheet to another using a macro, you might not get exactly what you want. This tip ...

Discover More

Excel Smarts for Beginners! Featuring the friendly and trusted For Dummies style, this popular guide shows beginners how to get up and running with Excel while also helping more experienced users get comfortable with the newest features. Check out Excel 2019 For Dummies today!

More ExcelTips (ribbon)

Setting a Length Limit on Cells

Limiting what can be entered in a cell can be an important part of developing a worksheet that other people use. Here are ...

Discover More

Switching Editing Location

Excel allows you to edit the contents of a cell in two places--"the cell itself or in the Formula bar. If you want to ...

Discover More

Defeating Date Parsing when Pasting Information

Paste information directly into a worksheet, and you may be surprised that Excel makes some of the data unusable. This ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is three more than 8?

2026-07-22 15:47:57

J. Woolley

The Tip's SentenceCaseSelection macro includes the following statement:
            sText = Application.Trim(c.Value)
Notice Application.Trim is the same as Worksheet.Trim unless there is an error; in that case, the former simply returns the error value but the latter interrupts processing and displays an error message (unless modified by an On Error... statement). On the other hand, the macro's objective does not require use of Trim; therefore, the previous statement can be replaced with this statement
            sText = c.Value
The macro also includes a multiline ElseIf...And...Then... statement that does not contribute to the objective; therefore, it can be deleted.
As discussed in my most recent comment below, the Tip's macro might have some difficulty with abbreviations because their terminating period (.) is treated as the end of a sentence. For example, the following text
    pick a color (e.g., red, blue, etc.) then click OK. what did you pick?
yields this result
    Pick a color (e.G., red, blue, etc.) Then click OK. What did you pick?
and this text
    notice e.g. and i.e. have no space after a period (.) but etc. does.
yields this result
    Notice e.G. And i.E. Have no space after a period (.) But etc. Does.
One of my earlier comments discussed AutoCorrect Exceptions, which are generally abbreviations. Here's an alternate version of the Tip's macro that ignores AutoCorrect Exceptions when evaluating sentence ending punctuation.

Sub SentenceCaseSelection2()
    Dim rCell As Range, sPrev As String, sText As String, sChar As String
    Dim n As Integer, bCapNext As Boolean
    'enable Tools > References > Microsoft Scripting Runtime
    Static Exceptions As Scripting.Dictionary, bExcept As Boolean
    On Error Resume Next
        If Exceptions Is Nothing Then 'do this once; result is Static
            Set Exceptions = New Scripting.Dictionary
            With CreateObject("Word.Application")
                If Err = 0 Then 'Microsoft Word is available
                    With .AutoCorrect.FirstLetterExceptions
                        bExcept = (Err = 0 And .Count > 0)
                        If bExcept Then 'AutoCorrect Exceptions
                            For n = 1 To .Count 'add lower-case as key
                                Exceptions.Add LCase(.item(n).Name), Null
                                Err.Clear 'in case key is duplicated
                            Next n
                        End If
                    End With
                    Err.Clear
                    .Quit 'Word.Application
                End If
            End With
        End If
    On Error GoTo 0
    For Each rCell In Selection
        If rCell.HasFormula = False And VarType(rCell.Value) = vbString Then
            bCapNext = True 'capitalize the cell's first word
            sPrev = vbNullString
            sText = rCell.Value
            For n = 1 To Len(sText)
                sChar = Mid(sText, n, 1)
                If bCapNext And sChar Like "[a-z]" Then 'capitalize this
                    Mid(sText, n, 1) = UCase(sChar)
                    bCapNext = False
                ElseIf sChar Like "[.?!]" Then 'end of sentence
                    bCapNext = True
                End If
                If bExcept Then 'consider Exceptions (lower-case)
                    If sChar Like "[a-z.]" Then
                        sPrev = sPrev & sChar 'possible exception/abbreviation
                    Else
                        sPrev = vbNullString 'reset
                    End If
                    If sChar = "." Then 'check for exception/abbreviation
                        bCapNext = (Not Exceptions.Exists(sPrev))
                        sPrev = vbNullString 'reset
                    End If
                End If
            Next n
            rCell.Value = sText 'update the cell's text
        End If
    Next rCell
End Sub

With this macro the following text
    pick a color (e.g., red, blue, etc.) then click OK. what did you pick?
yields this result
    Pick a color (e.g., red, blue, etc.) then click OK. What did you pick?
and this text
    notice e.g. and i.e. have no space after a period (.) but etc. does.
yields this result
    Notice e.g. and i.e. have no space after a period (.) But etc. does.
The last example is not perfect, but it is close.


2026-07-21 14:43:57

J. Woolley

The Tip's four formulas are based on Ginny wanting "...to make sure that ONLY the first letter of each sentence in a cell is capitalized." As discussed in my most recent comment below, I believe Ginny ONLY wants to make sure that the first letter of each sentence in a cell is capitalized. I don't think she wants to disturb the remainder of that sentence. This relates to Ginny noting "...in Word, she can easily make sure that sentences start with a capital letter."
The four formulas in the Tip capitalize the first letter of a sentence but reduce the remainder to lower case. This can easily be corrected by removing LOWER from each formula. (The remainder of this comment assumes LOWER has been removed.)
Notice the third formula =LET(... fails when presented with an abbreviation like e.g. or i.e. because it assumes sentence-ending punctuation is always followed by at least one space character. For example, this text
    abbreviations like e.g. and i.e. have no space after a period (.).
returns nonsense (which was not accepted when this comment was first submitted). However, that problem can be corrected by changing this part of the formula
    {".","!","?"}
and adding a space character after each sentence-ending punctuation like this
    {". ","! ","? "}
Then this text
    abbreviations like e.g. and i.e. have no space after a period (.).
returns this result
    Abbreviations like e.g. And i.e. Have no space after a period (.).
For this example, both the corrected third formula =LET(... and the fourth formula =REGEXREPLACE(... treat an abbreviation followed by at least one space as the end of a sentence; therefore, they capitalize the next word. On the other hand, an abbreviation followed by a character other than space is not sentence-ending, and this text
    pick a color (e.g., red, blue, etc.) then click OK. what did you pick?
returns this result
    Pick a color (e.g., red, blue, etc.) then click OK. What did you pick?
In conclusion, the corrected =LET(... formula and the =REGEXREPLACE(... formula will sometimes return a satisfactory result when the text includes an abbreviation, but not always.


2026-07-20 12:03:39

J. Woolley

The AutoCorrect option in the Tip's step 4 and Figure 1 is labelled "Capitalize first letter of sentences" but enabling it actually capitalizes the first letter AFTER typing a completed sentence. So if you manually type this
    pick a color (e.g., red, blue, etc.) then click OK. what did you pick?
you will see this
    pick a color (e.g., red, blue, etc.) then click OK. What did you pick?
Notice only the W in What was capitalized. Abbreviations were ignored; these are listed when you click the Exceptions button seen in Figure 1 of the Tip to open the AutoCorrect Exceptions dialog (see Figure 1 below)
The Exceptions and several of the AutoCorrect options are shared with Word; therefore, I believe this feature is referenced by Ginny when she "...notes that in Word, she can easily make sure that sentences start with a capital letter."
My Excel Toolbox includes the following dynamic array function to list the status of all AutoCorrect, AutoFormat As You Type, and Math AutoCorrect options indicated by tabs in the Tip's Figure 1:
    =ListAutoCorrectOptions([AddExceptions])
If optional AddExceptions is TRUE, the list will include all of the AutoCorrect Exceptions; default is FALSE for a result with 12 rows in 1 column. Exceptions add more than 280 rows in my test.
See https://sites.google.com/view/MyExcelToolbox/


Figure 1. 




2026-07-19 17:03:23

Tomek

On my version of Excel (365 Family, Win 11), the last, built in option, works well for multiple sentences in a cell, except the first sentence in that cell. Am I missing something?

On the other hand the exceptions settings prevent capitalization after common abbreviations like ft. in. Jan. Feb. etc.
I would remove Mr. Mrs. Dr. Prof. from the exceptions as they are usually followed by a capitalized name.


2026-07-18 14:15:59

J. Woolley

Ginny wants "...to make sure that ONLY the first letter of each sentence in a cell is capitalized." This might have some unintended consequences with respect to abbreviations and names.

Re. the Tip's first two formulas:
If cell A1 contains: Tell Mr. Allen Wyatt Hello.
Each formula returns: Tell mr. allen wyatt hello.

Re. the Tip's last two formulas, abbreviations like Mr., Dr., i.e., etc., are treated as the end of a sentence:
If cell A1 contains: Tell Mr. Allen Wyatt Hello.
Each formula returns: Tell mr. Allen wyatt hello.

But those last two formulas work well if there are no abbreviations or names:
If cell A1 contains: Join Me. Are You Ready? All For One. Let's Go!
Each formula returns: Join me. Are you ready? All for one. Let's go!


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.