Search code examples
google-sheetssyntaxstring-formattinggoogle-sheets-formula

stop Google Sheets from reformatting/structuring cell formulas


I have some formulas in a Google Sheet cell. If I restructure the formula, like by adding new lines or spaces, for legibility, it undoes my changes. Is there a way to stop this? It seems to only happen if the cell had the formula before. If I put the formula in a new cell it doesn't do that.

This is on Enterprise G-Suite so I cannot share an example sheet.

Blank cell:

blank cell

Add a structured formula:

add a structured formula

Now if I edit the structure it does not retain the changes. In the example below, I removed a new line after TRUE.

Before hitting enter:

editing structure before hitting enter

After hitting enter:

structure after hitting enter

Also, if I add the same formula to a new/different cell, regardless of how I structure it, it'll restructure to match the one from the other cell.


Solution

  • Google Sheets remembers forming even upon deletion/insertion in new cell. the only way how to achieve what you ask is to introduce a change that directly affects the output calculation. if the output calculation remains the same after the change in structure/formatting then your only possible option is to use lowercase for formula. in other words, if you change your IF to if or If or iF it will register it as new change and therefore the formating will be not reverted to the previous existing state.

    the less preferable but working solution would be to wrap it in some useless formula. for example:

    =QUERY(IF(TRUE, "hello", "bye"))