Easy Formulas to Remove Spaces
Simply, the paces inside an Excel string Cell are either:
- leading/starting spaces
- Mid spaces
- Trailing/ending spaces
✋ Before we start, we will assume that the data is in cell A1. We will insert the formulas starting from B1.Feel free to change cells reference to your references.
How to remove all extra spaces from an Excel cell?
This will include leading, mid, and trailing spaces
=TRIM(A1)
or
=SUBSTITUTE(A1," ","")
Remove Spaces and Clean Unprintable Characters
=TRIM(CLEAN(A1))
You may still see characters like(� , ⌷ , ¶) which are called "unprintable characters". How to remove them?
Most famous codes for the unprintable characters are:
- char(160) → �
- char(127) → ⌷
- char(182) → ¶
To remove these characters, you add them inside a SUBSTITUTE function (or a nested SUBSTITUTE function).
We will assume that we both � and ⌷ inside our string cell. So, we must have 2 SUBSTITUTE functions nested for each. Remember: � is char(160), ⌷ is char(127).
=TRIM(CLEAN(SUBSTITUTE(SUBSTITUTE(A2,CHAR(160),""),CHAR(127),"")))
And a bonus:
How to delete blank rows with keyboard shortcuts:
delete blank rows |
- Click on top of the column to highlight it all. or, inside any cell of the column Ctrl+Spacebar
- Press F5
- Click on Special
- Click on Blanks
- Press on Ctrl+-
- Choose "Entire row" and press ok or Enter
0 Comments
Your opinion matters, your voice makes us proud and happy. Your words are our motivation.