
Tips.Net > ExcelTips Home > Formulas > Simulating Alt+Enter in a Formula
Summary: When entering data in a cell, Alt+Enter allows you to start a new line within the current cell. In a formula you may want to create a new line, the same as if you had pressed Alt+Enter. There are two ways you can accomplish this task, both of which are explained in this tip. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, and Excel 2003.)
Kirk has a formula that concatenates text values: =A1 & A2 & A3. He is looking for a way to simulate the pressing of Alt+Enter between each of the concatenated values. There are two ways that this can be approached, and both end up with the same results.
The first method is to simply press Alt+Enter between the values as you are entering the formula. For instance, consider the following formula:
=A1 & "" & A2 & " " & A3
In this instance, every place that you see
=A1 & " " & A2 & " " & A3
If you find entering this type of formula distracting, you can always use the actual character code that Excel does whenever you press Alt+Enter. The following formula shows this approach:
=A1 & CHAR(10) & A2 & CHAR(10) & A3
The CHAR(10) inserts a line feed character, which is the same as is done by Excel when you press Alt+Enter.
If, after entering your formula, you don't see the results on separate lines, it is because you don't have wrapping turned on for the cell. Instead you'll see a small square box where the line feed character is located. To see the results of the formula on separate lines, use Format | Cells | Alignment tab to select the Wrap Text check box.
Tip #2788 applies to Microsoft Excel versions: 97 2000 2002 2003
PivotTables Got You Perplexed? Learn the ins and outs of this powerful data-crunching tool. ExcelTips: PivotTables for the Faint of Heart makes it easy.
Thousands of ExcelTips, available for immediate download. Have all the Microsoft Excel info you need, right at your fingertips. (more information...)
Ask an Excel Question
Make a Comment
ExcelTips FAQ
ExcelTips Premium
Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Money Tips
Pet Tips
Word2007 Tips
WordTips
Advertise on the
ExcelTips Site