How do you handle messy data with inconsistent spaces across hundreds of columns?
I just got handed a spreadsheet with over 300 columns and the data is a complete mess. Every single entry has a leading space before the actual text. Not trailing spaces just a space at the start of each cell. Someone apparently copy pasted from somewhere without trimming and now I have to clean this up for a report due Friday.
I know about the TRIM function but manually applying it to 300 columns one by one is going to take forever. I tried using find and replace with a space and replace with nothing but that also removes spaces between words which I need to keep. So thats not going to work.
Power Query seems like the obvious answer here but Im curious how others would approach this. If I load the whole table into Power Query I can select all columns and do a trim transform in one go which feels way faster. But I rarely work with this many columns and Im wondering if theres any performance downside or gotchas I should watch out for.
Also open to VBA solutions if anyone has a macro for this. Just trying to figure out the most efficient way before I commit to a method. Curious how the pros handle massive cleanup jobs like this.
[link] [comments]
Want to read more?
Check out the full article on the original site