Character Replacement in Simple Formulas

Written by Allen Wyatt (last updated November 25, 2023)
This tip applies to Excel 97, 2000, 2002, and 2003


Want to try an experiment? Enter something in a cell, but make sure that you start a new line somewhere within the cell. For instance, enter 123 then press Alt+Enter and press 456. You should see two lines within the cell, with three digits on each line. Now, in another cell, put a simple formula that references the first cell, as in =A7.

What happened after you entered the formula? The results of the formula should not look the same as what you typed in the first cell. Instead of being on two lines, the contents should be on one line, separated by a small, rectangular box. (See Figure 1.)

Figure 1. Odd characters: replaced in the formula?

It is interesting to note that this experiment works because when you press Alt+Enter to put in your first cell's value, Excel automatically turns on text wrapping for the cell. You can verify this by selecting the cell and choosing Format | Cells | Alignment tab (pay attention to the Wrap Text check box). When you used the formula, however, the cell into which the results were copied did not have this attribute turned on, so the character created by Alt+Enter was displayed as a text character instead of controlling wrapping.

If you turn on text wrapping for the target cell, then the text in the formula's cell will display on two lines, just like you would expect. Conversely, if you turn off text wrapping in the original cell, then the text folds back up to one line and the small, rectangular box appears.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3206) applies to Microsoft Excel 97, 2000, 2002, and 2003.

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

Editing While Spell-Checking

When you run a spell-check on a document, you may end up seeing other things that need to be edited. Never fear; you can ...

Discover More

Formatting Footnotes and Endnotes

Footnotes and endnotes can be formatted in the same way that you format regular text in your document. There is an easier ...

Discover More

CSV File Opens with Data in a Single Column

When you import a CSV file into an Excel worksheet, you may be surprised at how the program allocates the information ...

Discover More

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!

More ExcelTips (menu)

Calculating Statistical Values on Different-Sized Subsets of Data

Discovering different ways to analyze your data can be a challenge. Here's how to work with arbitrary subsets of a large ...

Discover More

Averaging the Last Numbers in a Column

Need to calculate a running average for the last twelve values in a constantly changing range of values? The formula ...

Discover More

Complex Lookup Formulas

If you need to combine information in some of your cells in order to produce a result needed to, in turn, look up other ...

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}] (all 7 characters, in the sequence shown) 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 seven minus 2?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

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.

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.