
Tips.Net > ExcelTips Home > Formulas > Character Replacement in Simple Formulas
Summary: Do you see some small rectangular boxes appearing in your formula results? It could be because Excel is substituting that box for a character it cannot display, as discussed in this tip. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)
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. (Click here to see a related figure.)
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.
It is interesting to note that the behavior noted above is not exhibited in Excel 2007. When you include the cell reference in your formula (=A7), the small rectangular box does not appear in the result of that formula as it does in earlier versions of Excel. The character is still maintained internally by Excel because if you turn on text wrapping for the cell, then the contents automatically wrap to the two lines, as they do in the source cell. The only difference is that the small rectangular box doesn't appear.
Tip #3206 applies to Microsoft Excel versions: 97 2000 2002 2003 2007
Step Up and Take Control! Subscribers to ExcelTips know just how valuable a resource it is. ExcelTips Premium provides twice the number of exceptional, easy-to-understand tips every week in an ad-free newsletter, as well as substantial discounts on ExcelTips archives and e-books.
Check out ExcelTips Premium today!
Have thousands of ExcelTips at your fingertips, on your own system. Answer your own questions or help support others. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Bugs and Pests Tips
ExcelTips
Family Tips
Health Tips
Home Tips
Organizing Tips
WordTips
Advertise on the
ExcelTips Site