Microsoft Office Tutorials and References
In Depth Information
Some Useful Worksheet Functions
The next formula returns TRUE because the first argument is a single character in the second
The following formula returns TRUE if cell A1 contains a, e, i, o, u, A, E, I, O, or U. Using the UPPER
function for the arguments makes the formula not case-sensitive.
The following formula returns TRUE if cell A1 contains a value that begins with 1 and has exactly
three digits (that is, any integer between 100 and 199).
Extracting the nth element from a string
ExtractElement is a custom worksheet function (which you can also call from a VBA
procedure) that extracts an element from a text string. For example, if a cell contains the following
text, you can use the ExtractElement function to extract any of the substrings between the
The following formula, for example, returns 0133 , which is the fourth element in the string. The
string uses a hyphen ( - ) as the separator.
The ExtractElement function uses three arguments:
h Txt : The text string from which you’re extracting. It can be a literal string or a cell reference.
h n : An integer that represents the element to extract.
h Separator : A single character used as the separator.
If you specify a space as the Separator character, multiple spaces are treated as a
single space, which is almost always what you want. If n exceeds the number of elements
in the string, the function returns an empty string.