Logo Wand.Tools

Free AI Excel Formula Generator

Convert your text instructions into Excel formulas, or get explanations for existing formulas.

TRIM Formula Tutorial

The TRIM function in Excel is used to remove extra spaces from text, leaving only single spaces between words and no leading or trailing spaces. This is particularly useful when cleaning up data imported from other sources.

Syntax:

=TRIM(text)
  • text: The text or cell reference from which you want to remove extra spaces.

Example:
If cell A1 contains the text " Hello World! ", the formula =TRIM(A1) will return “Hello World!”.

Steps to Use TRIM:

  1. Select the cell where you want the cleaned text to appear.
  2. Enter the formula =TRIM(A1) (replace A1 with the appropriate cell reference).
  3. Press Enter. The cell will now display the text without extra spaces.

Notes:

  • TRIM only removes spaces (ASCII 32). It does not remove non-breaking spaces (ASCII 160).
  • If you need to remove non-breaking spaces, use the SUBSTITUTE function in combination with TRIM.