Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Sheets pretty formulas formatting

I'm finding these increasingly harder to manipulate.

is there another way that avoids using the formula bar?

Some text editor that provides indentation perhaps?

crazy long formula

like image 508
Christopher Turnbull Avatar asked Oct 21 '25 18:10

Christopher Turnbull


2 Answers

You can press:

Ctrl + Enter on Windows

⌘ + Enter on a Mac

inside the formula editor bar to add new lines to your formulas in order to make them more readable.


To comment inside formulas, you can use N().

For example:

=SUM(A1:A)+N("This is a comment.")

this will give exactly the same result as:

=SUM(A1:A)

Note that:

N("This is a comment") 

returns 0.

If you want to avoid that, you can use T(N("comment")) which acts like a blank string.

Example:

example

like image 118
soMarios Avatar answered Oct 24 '25 14:10

soMarios


Probably not the best answer, but as I had the same problem before, what I do is copy the formula to a text editor (or pastebin), ident the formula, select all and then repaste in the google sheets formula. If pasted it will have a line break, like this:

={
ARRAYFORMULA(somecomplicatedstuffhere) ,
ARRAYFORMULA(moreformulashere) 
}

Also, if you are inside the cell, you can add a newline this way:

  • Windows: Ctrl + Enter
  • Mac/ Linux: + Option + Enter
like image 39
nabais Avatar answered Oct 24 '25 13:10

nabais



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!