Can you please help me to understand why you used INDIRECT("65:90").? What is the meaning of "65:90"?
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.
Split Names function can quickly split first names, middle names and last names from one cell into separate columns
- Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
- More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
- Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
- Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
- Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
- Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
- More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.
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:
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. 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
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:
Tip: If there is no uppercase in the string, the result displays as -1.
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.
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 120 handy Excel functions, enhance your working efficiency and save your working time.|
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:
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:
3. Then click Ok or Apply to change case.