I was working on a Google Spreadsheet and I found that it does not allow more than one white space anywhere.

Is there any option to stop auto trimming on text? I searched it but didn’t found any solution.

║ what google gives ║ what I want ║
║ text              ║    text     ║

You can use a formula workaround which should work regardless of the OS, eg:





It kept removing extra spaces, even when I placed a character in the front (e.g. =CHAR(160)&"text") and pasted those results over. Here's what worked for handling leading spaces (this solution won't accommodate text with trailing spaces):

Determine the number of leading/training spaces, in B1 enter: =LEN(A1)-LEN(TRIM(A1))

Paste the original text over to Google sheets, along with the results from the formula used above that counts leading/trailing spaces.

Then in a new cell, enter: =REPT(" ",B1)&A1

This worked for me!


You can add a leading ' in a text editor and then paste to google sheets.

'      <AMOUNT>34000</AMOUNT>

I always use the keystrokes "Alt+0160" or "Alt+255" to get it to indent.

You have to be in cell edit mode. Type the keystrokes above for a space. This solves your question "stop auto trimming on text" but your subject says "allow trailing white spaces". With the limited info I would say it works for that too.

This is useful for indenting and such in some formats.

  • thanks for your answer .. but I am using fedora os. When I press any number holding alt .. it changes the window ..
    – Let's Code
    Jun 19 '13 at 3:53
  • That being a critical part of your problem, would have been nice to see that in the question.
    – William
    Jun 19 '13 at 14:06

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.