Skip to main content

How to quickly find the position of first uppercase in Excel text string?

Author Sun Last modified

Supposing there is a list of text strings mixed with numbers, uppercase and lowercase letters, how can you quickly find the position of first uppercase letter from the strings? In this article, I introduce the tricks which can quickly specify the position of first upper case without counting them one by one manually in Excel.

Find position of first uppercase in string with formula

Find position of first uppercase in string with Defined Function

Change all letters to UPPERCASE or Proper Case with Kutools for Excel good idea3


arrow blue right bubble Find position of first uppercase in string with formula

Here is a formula which can help you quickly find the position of first uppercase from string, please do as below:

Select a blank cell next to the string you want to find the first uppercase, B1 for instance, enter this formula =MIN(IF(ISERROR(FIND(CHAR(ROW(INDIRECT("65:90"))),A1)),"",FIND(CHAR(ROW(INDIRECT("65:90"))),A1)))

Press Shift + Ctrl + Enter key to get the correct result, and then drag the auto fill handle over the cells which needed to apply this formula. See screenshot:
A screenshot of finding the first uppercase letter position in Excel


arrow blue right bubble Find position of first uppercase in string with Defined Function

Except formula, you also can use Defined Function to find out the position of first uppercase in the string.

1. Enable the sheet which contains the string you want to find uppercase, and press Alt + F11 keys to open Microsoft Visual Basic for Applications window.

2. Right click at the sheet you want to use the code in Project Explore pane, and click Insert > Module, and paste below code to the blank Module script. See screenshot:

Code: Find position of first uppercase from string.

Function GetFirstUpper(Rg As Range) As Integer
'UpdatebyExtendoffice20160726
    Dim xStr As String
    Dim I As Integer
    Application.Volatile
    GetFirstUpper = -1
    On Error Resume Next
    xStr = Trim(Rg.Value)
    For I = 1 To Len(xStr)
        If (Asc(Mid(xStr, I, 1)) < 91) And (Asc(Mid(xStr, I, 1)) > 64) Then
            GetFirstUpper = I
            Exit Function
        End If
    Next
End Function

A screenshot of adding VBA code in Excel

3. Save the code and go back to the sheet you use, and select a blank cell next to the string you want to find uppercase, enter this formula =GetFirstUpper(F1), press Enter key, and then drag autofill handle over cells needed this formula. See screenshot:
A screenshot showing the formula result for finding the first uppercase position using VB

Tip: If there is no uppercase letter in the string, the result will display as -1.


arrow blue right bubble Change all letters to UPPERCASE or Proper case with Kutools for Excel

In general Excel work, you may usually need to change letter strings to UPPERCASE, Proper Case, lowercase, Sentence case or ToGgLe CaSe as below screenshot shown.
A screenshot of Kutools options for changing text to UPPERCASE, Proper Case, etc.

With Kutools for Excel, you can apply its Change Case utility to quickly change the letter case as you need.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

After free installing Kutools for Excel, please do as below:

1. Select the strings you want to change their cases, and click Kutools > Text > Change Case. See screenshot:
A screenshot of Kutools' Change Case option in Excel

2. Then in the popping Change Case dialog, check the option you want in the Change type section, and you can preview the result in the Preview pane. See screenshot:
A screenshot of Kutools Change Case dialog with case options and preview

3. Then click Ok or Apply to change case.

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!