Excel string functions: An introduction
"String functions" refers to the category of functions in Excel that allow you to manipulate blocks of text in various ways. But before we dive into what string functions are and how they operate, let's define what we mean by "string".
In Excel, there are three types of inputs that we can use within formulas:
- Numbers are digits typed in directly on the keyboard. You can type numbers directly into the formula bar and use them as part of calculations, like the simple calculation
=4+6 , which outputs the number10 . - Strings are blocks of text that appear in Excel, like names of people, names of cities, e-mail addresses, or names of items sold in a store. When we type strings into Excel, we always use quotation marks around them to tell Excel that what it's about to read is one coherent block of text. For example, if we want to use the name "Sarah Smith" in a formula, we enclose it in quotes (
"Sarah Smith" ). - Cell references point to the contents of other cells (which contain numbers or strings). Cell references come in the format [
column_letter ][row_number ], likeC5 . If a cell reference points to a cell containing a string, the cell reference can be used as a string in a formula. Likewise, if a cell reference points to a cell containing a number, the cell reference can be used as a number in a formula.
We enclose strings in quotes to differentiate between strings and cell references; Excel needs to know which of these two different input types we are dealing with when it reads our formulas.
Also, note that we only need to enclose strings in quotes if they come in a formula led by an equals sign (
Using functions on strings
Now that we know what a string is, we have a better idea of what a "string function" is: a function designed to manipulate strings in various ways. There are numerous useful string functions, but they all take strings as one or more arguments to accomplish a variety of goals. Using string functions, you can:
- Combine two strings together into one larger string (e.g., put a user's name and domain together to form an e-mail address);
- Pull out important details of a string into a separate cell (e.g., isolate just the state abbreviation in a city, state combination);
- Split up strings based on a common delimiter (e.g., separate out a user's e-mail prefix from his or her domain name);
- Cut down a string so that only the important parts are passed on to another function (e.g., pull out just a user's last name based on an input cell containing his or her full name);
- And much more.
Check out our complete list of string functions to start learning about these useful tools.
Save an hour of work a day with these 5 advanced Excel tricks
Work smarter, not harder. Sign up for our 5-day mini-course to receive must-learn lessons on getting Excel to do your work for you.
- How to create beautiful table formatting instantly...
- Why to rethink the way you do VLOOKUPs...
- Plus, we'll reveal why you shouldn't use PivotTables and what to use instead...