The TRIM function in Microsoft Excel 2019

The TRIM function removes unwanted spaces in a cell. Itfalls under the string/text category. This is very useful when you haveimported data from another source and spaces exist at the end, middle,or beginning of data in a cell. To use this function, we will proceed asfollows:

  1. We will use the CONCAT.xlsx workbook for this example.The list of names and surnames on the sheet were imported from anothersource and have trailing spaces—actually, three spaces—at the start ofthe first name and at the end of the surname. We need to remove thesespaces from the data.
  2. Click on the TRIM worksheet. Select cell E3. Type theformula =trim(B3). PressEnter to see the result.
  3. The spaces are removed from the text in cell E3.
  4. Let’s do the surname. Click into cell F3 and type the formula =trim(C3). Press Enter to see theresult.
  5. Use Autofill to copy the formulato cells E4:E7 and F4:F7, respectively.

Leave a Comment