Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. 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: Simulating Alt+Enter in a Formula.

Simulating Alt+Enter in a Formula

by Allen Wyatt
(last updated January 6, 2016)

7

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 & "[ae]" & A2 & "[ae]" & A3

In this instance, every place that you see [ae] you would actually press Alt+Enter. Thus, you would end up with a formula that looked like this just before entering it:

=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, display the Format Cells dialog box (click the small icon at the lower-right of the Alignment group on the Home tab of the ribbon). On the Alignment tab select the Wrap Text check box.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (12568) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Simulating Alt+Enter in a Formula.

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

Maintaining Formatting when Inserting Documents

Word allows you to easily insert the contents of one document into another. Doing so, however, may result in unintended ...

Discover More

Printing a Chart Across Multiple Pages

Wouldn't it be great to have your huge charts print out on multiple pieces of paper that you could then piece together? While ...

Discover More

Getting the Name of the Parent Workbook

If you need to insert into a cell the name of the workbook in which a worksheet is contained, you can use the CELL function. ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Reordering Last Name and First Name

If you've got a list of names in a column, you may want to change the order of each name. For instance, the name have the ...

Discover More

Counting Jobs Completed On a Date

When you store the date and time in a single cell, it can be a bit confusing to count how many cells contain a particular ...

Discover More

Calculating the Median Age of a Group of People

Suppose you have a worksheet that contains a list of ages and then a count of people who correspond with those ages. You may ...

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 4 + 2?

2016-01-08 14:26:11

Tim Coddington

CHAR(10) is a line feed, not a carriage return-line feed. Many systems do not return the carriage when a CHAR(10) is encountered. Excel chooses, like many other systems to do so, but is is a choice, not a definition. CHAR(13) is the explicit carriage return.


2016-01-07 07:05:05

Kevin

Sorry for being not quite on topic but is there a method to get the Excel shortcuts back to their defaults.
In particular a Ctrl + Shift + End that is not highlighting the whole selection. It just goes to the last cell like its Shift doesn't get seen. Shift key works in normal operation.
Windows 10 so haven't had any success trying the terms referred in this tip.


2016-01-06 08:18:26

Chuck Trese

The vbLf and vbCrLf constants can be used in macros, but not in formulas.


2014-08-25 03:19:59

Aj

Thanks very much


2013-10-08 04:58:01

Barry Fitzpatrick

In Excel 2010 (and maybe other versions) when saving the file as a PDF and an "unknown char" is also printed (a question mark inside a square box), this doesn't display in Excel only in the PDF version.

The only workaround I've found so far is to pad out, at the point I want the break to occur, with lots of spaces.

Can anyone suggest an alternative?


2013-03-25 10:04:17

Duncan

I think vbLf is a predefined constant for linefeed, equivalent to CHAR(10), and vbCrLf is CarriageReturn + LineFeed


2013-03-24 00:24:32

Juan

Thank you very much for this tip, it's very nice!


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.