A text value (also called a “text string”) is one of Excel’s primary content types. Other types of content include numbers, dates, times, and Boolean values.
As data is entered into a worksheet, Excel makes a “best guess” on the type of content it is, and formats the value automatically. By default, text values are aligned on the left, and numeric values (including dates and times) are aligned on the right. This alignment quickly shows which values Excel considers text.
Text values in formulas
In a formula, text values require special treatment, and must be enclosed in double quotes (""). For example, the formula below uses the IF function to test a value in A1:
=IF(A1>70,"Pass", "Fail")
If A1 is greater than 70 , the result is “Pass”. If the value in A1 is less or equal to 70 , the result is “Fail”. Notice both “Pass” and “Fail” are surrounded with double quotes. This tells Excel to treat these values as text. The double quotes will not be visible in the final result.
ISTEXT function
To test if a value is text, you can use the ISTEXT function . In the formula below, ISTEXT will return TRUE if A1 contains text and FALSE if not:
=ISTEXT(A1)
Empty strings
Programmers refer to text values as “text strings”. A special kind of text value an " empty string “, which means a text value with no text. Empty strings will appear as empty double quotes (”"). You’ll see empty strings appear in formulas like this:
=IF(A1="","",A1)
Translation: if A1 is empty, return an empty string, otherwise return A1.
Empty strings don’t display anything in Excel. The formula above, when A1 is empty, will return a result that looks like an empty cell.
Enter number as text
To enter a number as text directly in a worksheet (i.e. not in a formula), precede the number with a single quote character (’). The resulting value will be text, but it will still look like a number. The single quote will not be visible.
A used range in an Excel worksheet is a concept that defines which cells in a worksheet have been used. In any given worksheet, the current used range can impact how many cells are involved in certain calculations. To find the last cell used in a worksheet (the lower right corner of the used range) you can use keyboard shortcuts:
- Go to the first cell in the worksheet (Ctrl + Home)
- Go to the last cell (Ctrl + End)
The used range is continually updated as changes are made to a worksheet, and includes any cell that has ever been used. For example, if A1 contains a value, and that value is deleted, cell A1 is still considered used. Sometimes, a worksheet will have a used range that is much larger than expected. This can cause performance problems and other unexpected behavior. One way to “reset” a used range is to delete all unused columns and rows.