Note: The other languages of the website are Google-translated. Back to English
English English

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

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.
doc insert-line-break-after-specific-character 1

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 is using 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.
doc insert-line-break-after-specific-character 2

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 disappeared. In my case, I don’t want the em dash character show in the cell.
doc insert-line-break-after-specific-character 3

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.
doc insert-line-break-after-specific-character 4

4. Repeat the above steps in the rest of cells one by one.
doc insert-line-break-after-specific-character 5

5. Widen Column A so you can see the complete lines in each cell.
doc insert-line-break-after-specific-character 6


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.
doc insert-line-break-after-specific-character 7

1. Select all the cells in which you want to start a new line after the comma character.
doc insert-line-break-after-specific-character 8

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.
doc insert-line-break-after-specific-character 9

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.

doc insert-line-break-after-specific-character 10

4. A Microsoft Excel dialog box pops up to remind you the replacements are done. Click OK.
doc insert-line-break-after-specific-character 11

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.
doc insert-line-break-after-specific-character 12

6. Now the text string in each cell is divided into multiple lines and displayed in full content.
doc insert-line-break-after-specific-character 13

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.
doc insert-line-break-after-specific-character 15


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.
doc insert-line-break-after-specific-character 16

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))

doc insert-line-break-after-specific-character 17

2. On the Home tab, click Wrap Text in the Alignment group.
doc insert-line-break-after-specific-character 18

3. Widen the column A to better display the content.
doc insert-line-break-after-specific-character 19

4. To narrow the gap between the content and the cell margin, go to 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.
doc insert-line-break-after-specific-character 20

5. Now you can get the final result with a great presentation.
doc insert-line-break-after-specific-character 21

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))

doc insert-line-break-after-specific-character 22


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
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations