Skip to main content

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

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:
doc find position of first uppercase 1


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. ight 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

doc find position of first uppercase 5

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:
doc find position of first uppercase 6

Tip: If there is no uppercase in the string, the result displays 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 UPPERCAEs, Proper Case, lowercase, Sentence case or ToGgLe CaSe as below screenshot shown.
doc find position of first uppercase 2

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

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

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:
doc find position of first uppercase 3

2. Then in the popping Change Case dialog, check the option you want in the Change type section, and you can preview the changing result in the Preview pane. See screenshot:
doc find position of first uppercase 4

3. Then click Ok or Apply to change case.

doc download 1

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

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...

Description


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!
Comments (3)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I would suggest use the new CHAR(SEQUENCE(26, 1, 65)) instead CHAR(ROW(INDIRECT("65:90"))) if you can, the new code is simpler to understand and gives me less problems with automatic tables
This comment was minimized by the moderator on the site
Hi,
Can you please help me to understand why you used INDIRECT("65:90").? What is the meaning of "65:90"?
This comment was minimized by the moderator on the site
65 to 90 is the code for uppercase characters, so this code checks what the position of the character code is within that range
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations