Excel Formula: extract all capital letters only
In Excel, as we know, the Text to Columns can split sentence into cells based on the delimiter. But in some times, you want to use a formula to solve the job. Here this tutorial, it provides an array formula can handle it.
Generic formula:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE (SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE (SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE (SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE (SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE (SUBSTITUTE(SUBSTITUTE(txt,"a",""),"b",""),"c",""),"d",""),"e",""), "f",""),"g",""),"h",""),"i",""),"j",""),"k",""),"l",""),"m",""),"n",""),"o",""), "p",""),"q",""),"r",""),"s",""),"t",""),"u",""),"v",""),"w",""),"x",""),"y",""), "z","")," ","") |
Arguments
Txt: the text string you want to extract uppercase letter only. |
How this formula work
To extract capital letter from cell B3, please use below formula:
=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE |
Press Enter key.
Explanation
SUBSTITUTE function replaces text or characters within a text string with another text or characters. Here the formula uses groups of SUBSTITUTE functions to replace all lowercase letter and spaces with nothing.
Sample File
Relative Formulas
- Extract from right until character
Here introduces the formula to extract text from right side of a given text until a specified character. - Trim Text To N Words
Here introduces the formula to extract n words from left side of a text string. - Split sentence into words
This tutorial provides formulas to separate words of sentence into separated columns. - Split dollars and cents
To split dollars and cents into two columns with formulas in Excel.
Relative Functions
- SUBSTITUTE function
Replace text based on given text. - COLUMN function
Returns the number of column which formula appears or returns the column number. - ROW function
Get the number of row. - SEARCH function
Find the position of a specific character or substring from the given text string. - IF function
Test for a specific condition.
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...
Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
- One second to switch between dozens of open documents!
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Increases your productivity by 50% when viewing and editing multiple documents.
- Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.