excel tip

TRIM

The TRIM formula in Excel is denoted =TRIM(text). This formula will remove any spaces entered before and after the text entered in the cell. For example, if A2 includes the name " Steve Peterson" with unwanted spaces before the first name, =TRIM(A2) would return "Steve Peterson" with no spaces in a new cell. Email and file sharing are wonderful tools in today's workplace. That is, until one of your colleagues sends you a worksheet with some really funky spacing. Not only can those rogue spaces make it difficult to search for data, but they also affect the results when you try to add up columns of numbers. Rather than painstakingly removing and adding spaces as needed, you can clean up any irregular spacing using the TRIM function, which is used to remove extra spaces from data (except for single spaces between words).

  • The formula: =TRIM(text).

Text: The text or cell from which you want to remove spaces. Here's an example of how we used the TRIM function to remove extra spaces before a list of names. To do so, we entered =TRIM("A2") into the Formula Bar, and replicated this for each name below it in a new column next to the column with unwanted spaces. Below are some other Excel formulas you might find useful as your data management needs grow.