8

Given some sheet at cell A1 if I write ="foo\nbar" then foo\nbar will be rendered as shown:

enter image description here

If I manually add a newline using the shortcut cmd + opt + enter then the expected output as shown:

enter image description here

It's a problem because it makes my formulas look bad, especially if I'm adding a title row with ARRAYFORMULA.

  • Is it possible to get some type of newline character interpolated?
  • How do you format your multiline formulas?
10

You can use char(10) instead of \n so if you need to replace them you can do

=SUBSTITUTE(A1,"\n",char(10))

enter image description here

or if your building the formula from scratch you can do:

="foo"&char(10)&"bar"

enter image description here

  • How would you approach multi line cells? Is it bad practice for title rows? – mbigras Mar 7 '17 at 3:29
  • multi line within a cell or multiple cells with newline? both are doable - as far as I'm concerned nothing is bad practice lol Ive built entire applications using only google sheets :-P if u have an example I can share how I would do it – Aurielle Perlmann Mar 7 '17 at 3:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.