How To Insert Line Break in Google Sheets? – Create New Line in Same Cell

Inserting a line break in Google Sheets is quite tricky since it doesn’t have any inbuilt feature or function for the same. However, with the help of various functions and keyboard shortcuts, we can easily make text go to the next line in Google Sheets. There are multiple methods with the help of which we can easily create a new line in the same cell. To help you familiarize yourself with all those methods, here is a detailed article where you can learn everything about inserting a line using Google Sheets Tips. Scroll down to learn more.

Table of Contents

Insert Line Break in Google Sheets Formula

As discussed above, there is no inbuilt formula to insert a line break in Google Sheets. However, using the SUBSTITUTE function, we can insert a line between the rows in the spreadsheet. The detailed steps on how to get this done in Google Sheets are given below:

  • 1st Step: Open the Google Spreadsheet where you want to insert the line break.
  • 2nd Step: Move to the cell where you want to get the results. I have text in A2, and hence here I am using cell B2.
  • 3rd Step: Enter the formula “=SUBSTITUTE(A2,”, “,CHAR(10))“.
  • 4th Step: Press the “Return” key and you will find the results as shown in the image.

insert-line-breaks3

You can simply drag the formula-applied cells to other parts of the cell to get the same results.

How To Add a New Line in the Same Cell in Google Sheets? – Keyboard Shortcut

Apart from the SUBSTITUTE function, one can also make use of keyboard shortcuts that help to add a new line in between the lines in a Google Spreadsheet. The keyboard shortcut to add the new line in the spreadsheet is explained below.

  • 1st Step: Open the Google Spreadsheet on your device.
  • 2nd Step: Now move to the cell where you want to move the text to the next line.
  • 3rd Step: Double click the cell or press F2 to edit the text in that particular cell.
  • 4th Step: Use the keyboard shortcut by pressing “Ctrl + Enter” or “Alt + Enter” on your keyboard.

 

You will see the line break. The above steps are one of the easiest methods to insert a new line break in Google Sheets.

Inserting a Line Break using the Copy and Paste Method

Another easy method to insert a line break in Google Sheets is to use the copy-paste method. The detailed steps on how to use the copy-paste method are given below:

  • 1st Step: Open Google Sheets and copy the text for which you would like to insert the line break.
  • 2nd Step: Launch any word processor app, such as Microsoft Word, Notepad, or others.
  • 3rd Step: Paste the text and manually create a line break by pressing the “Enter” key.
  • 4th Step: Once the line break is done, copy the entire text and navigate to the spreadsheet.
  • 5th Step: Double click the cell or press F2 to edit the cell.
  • 6th Step: Paste the copied data and you will see line breaks now.

insert-line-breaks3

How to Use Apps Script to Insert Line Breaks in Google Sheets?

One can easily insert the line breaks in Google Spreadsheets using the Apps Script function. The detailed steps for using the Apps Script to create line breaks in Google Sheets are explained below.

  • 1st Step: First, launch Google Sheets on your device.
  • 2nd Step: Click on the “Extensions” tab from the menubar and choose “Apps Script” from the drop down menu.
  • 3rd Step: Now copy and paste the following code into the code editor and click on the “Run” button.
function onEdit(e) {
 if (SpreadsheetApp.getActiveSpreadsheet().getSheetName() == 'Apps Scripts') {
 if (typeof e.value != 'object') {
 e.range.setValue(e.value.replace(", ", "\n"));
 }
 }
}

insert-line-breaks3

  • 4th Step: Once the code is executed successfully, come to the spreadsheet and enter the formula “onEdit (A2)”.

insert-line-breaks3

You will see cell A2 being edited with line breaks as shown in the image below.

Note: While you are running this code, make sure your sheet name is Apps Scripts for successful execution.

Line breaks are an excellent way to organize the content in your cells more effectively. It also ensures that all of your data is seen and not cut off when it becomes too long. So, using the above presented methods, use the best method that comes in handy for your dataset for adding the line breaks.

Leave a Comment