Google Sheets TRIM Extra Spaces for Schoolwork
To remove extra spaces from text in Google Sheets, type a formula such as =TRIM(" Asha Rao"), with the text inside quotation marks. Google says TRIM removes leading, trailing and repeated spaces, leaving just a single space between words, so a name typed with extra spaces comes out as Asha Rao.
Start with a practice sheet you own
Open your own unshared native Google Sheet on a computer. Check the account, the file title and your editing access. Use a new practice sheet with a few cells and nothing else nearby.
Do not change a teacher's template, a live tracker or another person's cells, and agree changes with the owner first. If the practice cells already hold values or formulas, stop and ask before going on.
This guide uses TRIM on three short fictional names, one cell at a time. It does not teach CLEAN, SUBSTITUTE, the Data cleanup menu, capital letters, running one formula down a whole column, replacing the original text, other languages' function names, or the mobile app.
Set out the fictional cells
A1 holds Case and B1 holds Trimmed. A2 holds leading space, A3 holds trailing space and A4 holds repeated spaces. B2, B3 and B4 are empty and are where the three formulas will go.
Google says Google Sheets trims text input into cells by default, so the extra spaces go inside quotation marks in each formula instead of in a cell. Google's TRIM page shows an example table where TRIM removes the spaces before and after the text Google Docs and gives Google Docs. If TRIM works the same way here, B2, B3 and B4 should show Asha Rao, Meera Das and Ravi Nair. That cell version is this guide's own expectation and was not run in Sheets.
Remove the spaces with TRIM
- Check that A1:B4 are empty on the practice sheet.
- Type Case in A1 and Trimmed in B1.
- Type leading space in A2, trailing space in A3 and repeated spaces in A4.
- In B2, type =TRIM(" Asha Rao") with one space after the first quotation mark, and press Enter.
- In B3, type =TRIM("Meera Das ") with one space before the last quotation mark, and press Enter.
- In B4, type =TRIM("Ravi Nair") with three spaces between the names, and press Enter.
Google gives the form TRIM(text) and the sample usage TRIM(" lorem ipsum") and TRIM(A2). Google's TRIM page does not say how to finish typing a formula. MakeUseOf says to press Enter after typing the formula, and this guide follows that for the key press.
Type each formula on its own, as above. This guide does not run one formula down a column or point TRIM at a typed cell.
Check the names and the cells
- Check that B2 shows Asha Rao, B3 shows Meera Das and B4 shows Ravi Nair.
- Check that each name has a single space between the first and last name and none at the start or end.
- Check that A2, A3 and A4 still hold the labels you typed.
- Check that the quotation marks in each formula are straight and closed, with the spaces inside them.
- Compare the cells next to the table with how they looked before.
Extra spaces are hard to see, so if a result looks the same as before, stop and read the formula. Do not retype the result by hand to match this guide. Leave an unexpected formula alone and ask the owner.
Know what TRIM does
Google says TRIM removes all spaces in a text string, leaving just a single space between words. It also says spaces in front of or after text are significant in formulas and data validation, which is why TRIM matters there.
Google also says whitespace or a non-breaking space will not be trimmed. A name copied from a web page can hold one, and TRIM leaves it in place.
For a real list, Google's sample usage is TRIM(A2), which points at a cell. This guide does not use it, does not replace the original column, and does not teach a fix for a non-breaking space. These steps were not run in Sheets.
Check the required output and hand-in separately
If a PDF, form or printout needs the names, check that actual file or field. A formula result in the editor is not proof of what the file shows. Follow the teacher's hand-in instructions separately.
A trimmed name does not check the work, grant access or submit the assignment. These are source checks, not a hands-on Sheets or student-account test. No mobile parity, export fidelity, accessibility compliance or grade benefit is promised.
Common questions
How do I remove extra spaces in Google Sheets?
Use TRIM. Google says TRIM removes leading, trailing and repeated spaces in text, leaving a single space between words. In this practice B2 holds =TRIM(" Asha Rao"), so it should show Asha Rao. This was not run in Sheets.
Why are the spaces typed inside the formula in this guide?
Google says Google Sheets trims text input into cells by default, so extra spaces typed straight into a cell may not stay. Putting the text inside quotation marks in a formula, as Google's own TRIM examples do, keeps the spaces for the practice. This guide did not test how Sheets treats typed cells.
Does TRIM remove every kind of space?
No. Google says whitespace or a non-breaking space will not be trimmed. Names copied from a web page can hold a non-breaking space that TRIM leaves alone. This guide does not teach a fix for that.
Does TRIM change the original text?
This guide does not expect it to, because the formula sits in its own cell and gives a new text result. Google's page does not say this and this guide did not test it. Keep the original text where it is and check it after you press Enter.
Does TRIM make a name correct?
No. TRIM only removes extra spaces. It does not fix capital letters or spelling. Check the real name and follow the teacher's separate hand-in instructions.
Sources and scope
Sources checked . Google controls the TRIM form, the sample usage, the default trimming note, the non-breaking space note and the Google Docs example. The other pages are secondary and support context only. Their wording is not Google confirmation.
- Google help: TRIM - the TRIM(text) form, the sample usage, the notes on default trimming, repeated spaces and non-breaking spaces, and the example table where TRIM gives Google Docs from text with spaces before and after it.
- Sheets Bootcamp: TRIM and CLEAN - says =TRIM(" SHERLOCK HOLMES ") removes leading, trailing and extra internal spaces. Its CLEAN, LEN and CHAR(160) advice is not taught here.
- MakeUseOf: TRIM in Google Sheets - says copied or imported text often brings extra spaces, and says to press Enter to run the formula. Its Trim whitespace menu and nested formulas are not taught here.
- Better Sheets: clean up names in a list - a video transcript saying a stray space at the end of a name can make the same name look different. Its unique-list steps are not taught here.
- Spreadsheet Practice: clean a whole column of names - says TRIM removes extra spaces and works on one cell. Its ARRAYFORMULA and PROPER method is not taught here.
- sheets.works: clean data in Google Sheets - says =TRIM(A2) removes leading, trailing and extra spaces and that TRIM does not catch CHAR(160). Its other cleanup steps are not taught here.