top of page

Just a TRIM


Have you ever copied some text from another source and then realised it had an extra space(s) either before or after the word / value? How did you remove it?

If it existed in only a small number of cells, sure no problem; you might have just removed it manually from each cell.

But what happens if an extra space existed in more than 50 entries?

My solution to removing extra spaces from text? Use TRIM function / formula. If you start typing, “=TRIM” in Excel, a prompt appears telling you what the formula will do. It says “removes all spaces from a text string except for single spaces between words”. The crucial word in that prompt is text string. This means that the formula will only work on words / text.

Example

I’ve copied a list of States in the US from Wikipedia. I can see there’s an extra space before each state. As there are 50 states, that is 50 rows that contains extra space; it’s going to take me a while to remove it manually.

Using TRIM:

Excel Formula: =TRIM(text)

Formula Made Easy

Based on the above photo, if I were to fill in the cell references into my Formula Made Easy table, it will look like:

Formula Applied

Putting the above references into the Excel formula, it will be:

  • =TRIM(A1)

Note:

コメント


bottom of page