Please Note: This article is written for users of the following Microsoft Excel versions: 2007 and 2010. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Combining Numbers and Text in a Cell.

Combining Numbers and Text in a Cell

by Allen Wyatt
(last updated October 12, 2016)

4

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 (9306) applies to Microsoft Excel 2007 and 2010. You can find a version of this tip for the older menu interface of Excel here: Combining Numbers and Text in a Cell.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Can't Save a Macro

Macros can make your use of Word faster and easier than ever before. What do you do, however, when you try to save a ...

Discover More

Converting Strings to Numbers

When working with data in a macro, there are two broad categories you can manipulate: numbers and text. Sometimes you ...

Discover More

Conditionally Playing an Audio File

You can add audio files to an Excel worksheet, but what if you want a particular audio file to play only when a value in ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

More ExcelTips (ribbon)

Locating a Single-Occurrence Value in a Column

Given a range of cells containing values, you may have a need to find the first value in the range that is unique. This ...

Discover More

Splitting Cells by Case

Excel provides several different ways that you can split apart the contents of a cell. One way it doesn't provide is to ...

Discover More

Calculating an IRR with Varying Interest Rates

You might wonder how you can calculate an IRR (internal rate of return) when the person repaying the loan pays different ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is six minus 3?

2016-10-12 08:23:41

PhilW

JD, if you want your formula result to be treated as a numeric value, you can format the cell containing the formula with a custom number format. In your example, you could remove the TEXT function and the &" LITERS" from your formula and apply a custom format to the cell. Something like: 0.00 " LITERS" in the Custom Type field under Format Cells/Number tab.
This will still display with the LITERS label, but the cell value will be numeric instead of text, which is useful if you want to perform any calculations on the cell.


2016-10-12 08:14:18

Barry

These techniques whilst are of merit have one important side effect which is the result cannot be used in further calculations should the need arise (or not without a lot of difficulty).

Another way of achieving the same result is to use Custom Formatting of cells so the equivalent formatting for the above examples would be:

1. "3.27 miles." would be formatted as 0.00" miles" cell would be =3.27
2. ="1 + 1 is " & 1+1 would be formatted as "1 + 1 is " 0; cell would be =1+1
3. ="1 + 1 is " & TEXT(1+1, "0.00") would become the format "1 + 1 is " 0.00 ; cell is =1+1
4. ="Today is " & TEXT(NOW(),"dddd, mmm dd, yyyy") would be formatted as "Today is " dddd, mmm dd, yyyy and the cell having the formula =NOW()


2016-06-20 05:41:01

T. van der Kooi

Helpful tip!


2015-09-10 08:15:44

JD

Very helpful!!
I was trying to figure out how to remove additional decimal places in value derived from lookup table and used with additional text...
=TEXT(LOOKUP(H16,'Drop Down and Lookup'!U4:U43,'Drop Down and Lookup'!U5:U43),0)&" LITERS"


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.