How can I use the TRIM function in Google Sheets to remove excess spaces from a string of text?

How can I use the TRIM function in Google Sheets to remove excess spaces from a string of text?

The TRIM function in Google Sheets is a useful tool that allows users to remove excess spaces from a string of text. This function is particularly helpful when dealing with data that has been copied and pasted from external sources, as it often contains unnecessary spaces. By using the TRIM function, users can easily clean up their data and ensure that it is free of any extra spaces. This function can be accessed through the formula bar in Google Sheets and can be applied to both single cells and ranges of cells. By using the TRIM function, users can effectively manipulate their data and improve the accuracy and professionalism of their spreadsheets.

TRIM function

Removes leading, trailing, and repeated spaces in text.

Sample Usage

TRIM(" lorem ipsum")

TRIM(A2)

Syntax

TRIM(text)

  • text – The string or reference to a cell containing a string to be trimmed.

Notes

  • Google Sheets trims text input into cells by default.

  • It is important to use TRIM when text is used in formulas or data validation because spaces in front of or after the text are significant.

  • TRIM removes all spaces in a text string, leaving just a single space between words.

  • Whitespace or non-breaking space will not be trimmed.

See Also

SUBSTITUTE: Replaces existing text with new text in a string.

REPLACE: Replaces part of a text string with a different text string.

Examples

[wpcc-iframe height=”300″ src=”https://docs.google.com/spreadsheet/pub?key=0As3tAuweYU9QdG1xd21mTkRHbHYtVHgxTU5CTnNTMEE&output=html” width=”500″]

Cite this article

stats writer (2024). How can I use the TRIM function in Google Sheets to remove excess spaces from a string of text?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-use-the-trim-function-in-google-sheets-to-remove-excess-spaces-from-a-string-of-text/

stats writer. "How can I use the TRIM function in Google Sheets to remove excess spaces from a string of text?." PSYCHOLOGICAL SCALES, 1 Jul. 2024, https://scales.arabpsychology.com/stats/how-can-i-use-the-trim-function-in-google-sheets-to-remove-excess-spaces-from-a-string-of-text/.

stats writer. "How can I use the TRIM function in Google Sheets to remove excess spaces from a string of text?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-use-the-trim-function-in-google-sheets-to-remove-excess-spaces-from-a-string-of-text/.

stats writer (2024) 'How can I use the TRIM function in Google Sheets to remove excess spaces from a string of text?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-use-the-trim-function-in-google-sheets-to-remove-excess-spaces-from-a-string-of-text/.

[1] stats writer, "How can I use the TRIM function in Google Sheets to remove excess spaces from a string of text?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, July, 2024.

stats writer. How can I use the TRIM function in Google Sheets to remove excess spaces from a string of text?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top