Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Combining Numbers and Text in a Cell.
by Allen Wyatt
(last updated June 1, 2018)
Many times I want a description for my data. One approach is to put the description—a simple text string—near the cell containing the data that needs describing. For instance, a numeric value could go in cell B3, and the unit description in cell C3, which read together may be something like "3.27 miles."
Another approach is to put the description text and the numeric value together. Creating text strings easily accomplishes this feat. Here's a very simple example that displays "1 + 1 is 2."
="1 + 1 is " & 1+1
The quotation marks are important. By making the text string part of a formula, you can combine the description and the value within one cell.
The disadvantage of this approach is formatting the value takes more effort; since the result is a text string, numeric cell formatting does not apply. For example, consider the above formula and the need to display two decimal places. One might naturally display the Format Cell dialog box and then choose a Number format that has two decimal places, but the results would not change. (Remember, the result of the formula is text, not a number.)
To affect the value formatting, use the TEXT function. To force the above results to display the value to two decimal places, use the following formula.
="1 + 1 is " & TEXT(1+1, "0.00")
The different formats you can use with the TEXT function have been covered in other issues of ExcelTips, and you can also find more info in Excel's Help system. Here's an example that displays "Today is " along with today's date. Enter the following formula in some cell:
="Today is " & TEXT(NOW(),"dddd, mmm dd, yyyy")
Again, the quotation marks are important, as you are constructing a text string.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2582) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Combining Numbers and Text in a Cell.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
In a series of values you may need to know the smallest value that isn't a zero. There is no built-in function to do ...Discover More
An easy way to create a name for a formula or constant value. The name can then be used in other formulas or for ...Discover More
Figuring out how to average data that is in a contiguous range of cells is easy. When the data is spread over a group of ...Discover More
Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.