35

When accessing a spreadsheet in Google Drive on a computer with a keyboard, I can enter a new line in a single cell by pressing alt+enter.

My keyboard on my Android doesn't even have an alt key.

How do I enter a new line on my Android device?

For a keyboard on my Android, I'm currently using Swype, but I am assuming, and hoping, there is some kind of general approach that is not specific to a particular keyboard.

ale
  • 19,723
  • 34
  • 110
  • 159
Questioner
  • 3,729
  • 23
  • 60
  • 88
  • 2
    I'm afraid there is no "general approach" for that. You might want to take a look into my list on Keyboards & Input Methods, which holds several candidates like Hackers Keyboard which support such "additional keys". – Izzy Sep 12 '14 at 09:53
  • Idea #1 to try: create a "reference document" with a single cell where you put in the "new line" character in the cell on a PC and then use copy and paste on your Android device. Idea #2: does Google sheets support macros? – Gdalya Sep 18 '14 at 17:35
  • PERFECT ANSWER, RIGHT HERE GUYS:

    http://webapps.stackexchange.com/questions/25359/how-does-one-add-a-new-line-in-a-cell-in-a-google-spreadsheet

    –  May 27 '15 at 01:05
  • @user110230, that answer only applies to desktop computers, not to Android phones. – Questioner May 27 '15 at 06:24

8 Answers8

32

Easiest way: add an extra letter at the end of the line. Select that letter. Hit enter. The letter will be replaced with a new line.

5

The function CHAR(10) will return a Line Feed.

Combining with functions like CONCATENATE() or & will give a new line. Example:

=CONCATENATE("First line"; CHAR(10); "Second line")
="First line"&CHAR(10)&"Second line"
Andrew T.
  • 15,988
  • 10
  • 74
  • 123
Tzunki
  • 411
  • 3
  • 9
4

The only way that I found so far is through the clipboard.

Using a source document with a line break, with some effort you could succeed in selecting just the line break, and then copy/paste it.

Even easier is to use an app such as "Unicode Pad" or "Unicode CharMap", both of which will find and then copy/paste any character. You'll need to look for LF, LINE FEED or U+000A.
Note that you won't "see" the character after you select it, it shows as a space for obvious reasons.
This still isn't as convenient as I would like it to be, but at least I found it to work reliably.

Peter B
  • 141
  • 3
3

Mark the cell in which you want to have new lines.

At the top menu click the "A" next to the redo button.

Select submenu

in the lower screen section a modal pops up. There hit the tab "CELL".

Than activate "Wrap Text".

Cell + Wrap Text

Now this cell will do line-breaks on long text.

fab5
  • 39
  • 1
3

The highlight a throw-away character and hit enter trick, as well as the type everything into a text editor, then copy/paste it into the Google Sheets cell, both only work on Android devices. I have a Google Spreadsheet that I'm sharing with a client who has an iPhone, and she needs to be able to enter multiple lines within a cell. So I came up with just a little Google Apps Script code to do it on her iPhone (can be entered into the drop-down menu of the Google Spreadsheet, Tools >> Script editor):

function onEdit(e) {
    e.range.setValue(e.value.replace(/\\\\/g, '\\').replace(/ *\\n */g, '\n').replace(/\/g, '\\'));
}

Basically, that creates a function (that is automatically linked to a Google Sheets trigger), and will run every time a cell is edited. It simply replaces all of the "\n" characters in your text with a line-break. Make sure that's a backslash, and not a normal slash. For programmers, the "\n" is a special character that represents a carriage return within a string. The only possible exception where an accidental line-break might happen would be when trying to input a Windows path into a cell such as "C:\Users\John\Documents\news". So double-backslashes is the common workaround for Windows paths among programmers. So one could enter "C:\Users\John\Documents\news" or even just simply "C:\Users\John\Documents\news" (since \n is really the only string we're replacing at this point).

It's also possible to change the replacement characters, in case anyone is more familiar with HTML:

function onEdit(e) {
    e.range.setValue(e.value.replace(/ *<br *\/*> */ig, '\n'));
}

Since "<br>" is much more deliberate (people don't accidentally type that in unless they want a line-break), it makes for a simpler replace function, since we don't have to do an escape for double-backslashes. But personally, typing in the angled brackets from an Android touchscreen keyboard are a bit inconvenient to do so twice for every line-break...

-Ted

Ted
  • 31
  • 1
  • Nice, I think this is by far the most convenient way! I used myself just " lb " (as in line break) to be the value to be replaced with the newline so I can just write "line 1 lb line 2" and don't even need to go to special characters :) – Hemaolle Aug 14 '20 at 08:44
1

The following trick worked for me: Ctrl + Enter

user275859
  • 11
  • 1
  • 6
    Mind to explain where Android devices have the Ctrl key? Note this site is about Android, not Desktop. – Izzy Oct 04 '18 at 13:14
  • I assume (but haven't tested) that this might work on 3rd-party keyboard apps that have Ctrl key like Hacker's Keyboard. – Andrew T. Oct 08 '19 at 07:09
0

I have succeeded by pressing several times Enter when typing a message, select all, copy it and paste it into a cell in a sheet.

-2

Just select a line and press + (top right on the tool bar), you'll be offered to insert a row above or below or a link.

cyb
  • 1
  • 2
  • 1
    Note that the OP wants to insert a new line inside a cell, or probably should be called as line break instead... but not a new row. – Andrew T. May 14 '15 at 06:16