CS50 Python , Nutrition Facts Table
|
|
| Excel formulas to remove spaces and clean your data efficiently. |
Simply, the paces inside an Excel string Cell are either:
✋ 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.
This will include leading, mid, and trailing spaces
=TRIM(A1)
or
=SUBSTITUTE(A1," ","")
=TRIM(CLEAN(A1))
You may still see characters like(� , ⌷ , ¶) which are called "unprintable characters". How to remove them?
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:
|
|
| Step-by-step guide to delete blank rows and clean your Excel dataset. |
Comments
Post a Comment
Your opinion matters, your voice makes us proud and happy. Your words are our motivation.