Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to insert a line break in a cell after a specific character?

Author Zhoumandy Last modified

When you are dealing with long text strings in Excel, you probably want to shorten them and make them "display in multiple lines" in each cell. This tutorial will show you three ways to insert a line break in a cell after a specific character.
insert a line break in a cell

Add a line break after a specific character one by one

Insert a line break after a specific character using Find and Replace feature

Add a line break after specific characters using formula


This basic method of adding a line break in an Excel cell uses the "Alt+Enter" keys. When the text string in a cell is relatively long, but not too long, the Alt+Enter method can help you quickly insert a line break after a specific character in a cell. In the data below, we need to insert a line break after the "em dash character" in each cell, please do as follows.
sample data

1. Double-click cell A2 in which you want to insert a line break after the "em dash character".

2. Place the cursor after the em dash character or select the em dash character if you prefer it to disappear. In my case, I don’t want the em dash character to show in the cell.
Place the cursor after the specific character

3. Press "Alt+Enter" to insert the line break and replace the em dash character. Please make sure the "Wrap Text" feature is turned on.
Press Alt+Enter to insert the line break

4. Repeat the above steps in the rest of cthe ells one by one.
repeat the steps to change other cells one by one

5. Widen Column A so you can see the complete lines in each cell.
Widen the Column to see the complete lines

a screenshot of kutools for excel ai

Unlock Excel Magic with Kutools AI

  • Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
  • Custom Formulas: Generate tailored formulas to streamline your workflows.
  • VBA Coding: Write and implement VBA code effortlessly.
  • Formula Interpretation: Understand complex formulas with ease.
  • Text Translation: Break language barriers within your spreadsheets.
Enhance your Excel capabilities with AI-powered tools. Download Now and experience efficiency like never before!

When the text string in a cell is "too long" and contains quite a few this special character, using the Alt+Enter method will consume too much time. In this case, Excel’s "Find and Replace" feature can help you insert a line break after a specific character in each cell within a few clicks. In the data below, we need to add a line break after the "comma character" in each cell and remove the comma together. Please do as follows.
sample data

1. Select all the cells in which you want to start a new line after the comma character.
Select all the cells

2. On the "Home" tab, in the "Editing" group, click "Find & Select" > "Replace". Or you can press the "Ctrl + H" keys to open the "Find and Replace" dialog box.
click Find & Select > Replace under the Home tab

3. The "Find and Replace" dialog box pops up.

  • In the "Find what" box, if your text string in a cell is separated by commas with spaces, input a comma (,) and a space. If not, just type a comma (,).
  • In the "Replace with" box, press "Ctrl+J" to insert a carriage return.
  • Click the "Replace All" button.

specify the options in the dialog box

4. A Microsoft Excel dialog box pops up to remind you the replacements are done. Click "OK".
a dialog box pops up to remind you the replacements are done

5. Widen Column A to your needs, then on the "Home" tab, click the "dialog box launcher" (a small arrow in the lower-right corner of the Alignment group). The "Format Cells" dialog box pops up. Under the "Alignment" tab, choose "Top", "Center", or "Bottom" in the "Vertical" box.
steps to widen Column

6. Now, the text string in each cell is divided into multiple lines and displayed in full content.
The text string in each cell is divided into multiple lines

Note: when you only press "Ctrl+J" in the "Replace with" box, the comma (,) will be replaced by a line break. If you prefer the comma to be kept, in the Replace with box, input a comma then press "Ctrl+J".
set options to keep the comma in the Find and replace dialog box


Another method of inserting new lines after specific characters is using the help of the "SUBSTITUTE" function. And it isn’t limited to just one type of character, one time. We can add a line break after "several specific characters" in a cell using a formula. In the data below, we need to add new lines after the "comma (,)" character and the "question mark (?)", please do as follows.
sample data

1. Please copy the formula below into cell A5, then press the Enter key to get the result.

=SUBSTITUTE(SUBSTITUTE(A2,",",","&CHAR(10)),"?","?"&CHAR(10))

enter a formula

2. On the "Home" tab, click "Wrap Text" in the "Alignment" group.
click Wrap Text under Home tab

3. Widen column A to better display the content.
Widen the specific column

4. To narrow the gap between the content and the cell margin, go to the "Home" tab, click the "dialog box" launcher (a small arrow in the lower-right corner of the "Alignment" group). The "Format Cells" dialog box pops up. Under the "Alignment" tab, choose "Top", "Center", or "Bottom" in the "Vertical" box. Click "OK".
steps to narrow the gap

5. Now you can get the final result with a great presentation.
get the result with a great presentation

Notes:

  1. In the formula above, CHAR(10) represents a line break.
  2. If you prefer the specific characters to be replaced by the line breaks, change the formula to this version:

    =SUBSTITUTE(SUBSTITUTE(A2,",",","&CHAR(10)),"?","?"&CHAR(10))

 another formula to replace specific characters by the line breaks


Other Operations (Articles)

How To Quickly Remove Line Breaks In Excel?
Sometimes, when you copy some data from the website or you separate your values with Alt + Enter keys, you will get some line breaks or carriage returns, if you want to quickly remove multiple line breaks in Excel, you can get it done as follows.

How To Replace Line Breaks With Br In Excel?
For replacing all line breaks in a range of cells with br in Excel, a method in this article can help you.

How To Filter All Cells With Line Break Or Carriage Return In Excel?
Normally, you may press Alt + Enter keys to wrap the cell contents to multiple lines within a cell, but, how could you filter all cells with these line break characters in Excel?

How To Combine Cells With Line Break / Carriage Return In Excel?
In Excel, we can combine multiple rows, columns or cells into one cell with the CONCATENATE function, and the combined contents can be separated by comma, dash, semicolon and other characters. But, have you ever tried to combine the cells with line break?


  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns and Keeping Data; Split Cells Content; Combine Duplicate Rows and Sum/Average... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Favorite and Quickly Insert Formulas, Ranges, Charts and Pictures; Encrypt Cells with password; Create Mailing List and send emails...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • Pivot Table Grouping by week number, day of week and more... Show Unlocked, Locked Cells by different colors; Highlight Cells That Have Formula/Name...
kte tab 201905
  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom