Share via

Carriage return in excel formula

Anonymous
2019-07-21T20:25:33+00:00

I would like to put a carriage return into a excel formula so that a text string such as :

ab 12 cd 34 ef 56...etc

looks like this instead

ab 12

cd 34

ef 56

Anyway to do this in excel or word?

thanks

David

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2019-07-21T20:31:56+00:00

    HI David,

    You can use this formula for that specific text. You'd need to change it for other text.

    Also, you need to format the cell to include "Wrap text" under cell formatting.

    ="ab 12" & CHAR(10) & "cd 34" & CHAR(10)&"ef 56"

    40+ people found this answer helpful.
    0 comments No comments
  2. DaveM121 871K Reputation points Independent Advisor
    2019-07-21T20:35:36+00:00

    Hi David

    Make sure you right click that cell, choose Format Cells and that Wrap Text is set on

    The way to add a carriage return to a string is to use &Char(10)&

    So for example, you can use this:

    ="ab 12" & Char(10) & "cd 34" & Char(10) & "ef 56"

    10+ people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2019-07-21T22:56:21+00:00

    When you are entering the text, or editing the cell later, use <ALT><ENTER> to create the new lines inside the cell

    https://exceljet.net/keyboard-shortcuts/start-a-new-line-in-the-same-cell

    Or you can use something like this tool

    @Excel Formula Beautifierhttp://excelformulabeautifier.com/?numberOfSpaces=3 

    Parses Excel formulas with indentation ie: =IF(SUM( IF(FOO = BAR, 10, 0), 10 ) = 20 , “FOO”, “BAR”)

    is converted to

    =IF(

        SUM(

            IF(

                FOO = BAR,

                10,

                0

            ),

            10

        ) = 20,

        “FOO”,

        “BAR”

    )

    You can copy the spaced out formula back in to Excel in the formula bar (not the cell!) and it will maintain the spacing.

    Enlarging the Formula Barhttp://excelribbon.tips.net/T011705_Enlarging_the_Formula_Bar.html****The Formula bar is used to display the formula that appears in a cell. You may want to modify how the Formula bar is displayed. Your modification options are limited, as discussed in this tip.

    Formula bar in Excel: show, hide, expand or collapse       2016 01 21   Svetlana Cheusheva

    https://www.ablebits.com/office-addins-blog/2016/01/21/formula-bar-excel/

    In this short tutorial, you will learn what the Excel formula bar is, how to restore a missing formula bar in different versions of Excel, and how to expand the formula bar so that a long formula can fit into it entirely.

    .  *  What is a formula bar in Excel?

    .  *  How to show formula bar in Excel

    .  *  How to hide formula bar in Excel

    .  *  How to expand and collapse formula bar

    10 people found this answer helpful.
    0 comments No comments