EZ TuitionsAll tuitions

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

  1. Check that A1:B4 are empty on the practice sheet.
  2. Type Case in A1 and Trimmed in B1.
  3. Type leading space in A2, trailing space in A3 and repeated spaces in A4.
  4. In B2, type =TRIM(" Asha Rao") with one space after the first quotation mark, and press Enter.
  5. In B3, type =TRIM("Meera Das ") with one space before the last quotation mark, and press Enter.
  6. 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

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.