A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Re: "It leaves the trailing spaces"
Most likely those spaces are Character 160 (called a non-breaking space).
This formula removes almost all unnecessary characters...
=SUBSTITUTE(CLEAN(TRIM(A2)), CHAR(160), "")
This formula gets just the non-breaking spaces...
=SUBSTITUTE(A2, CHAR(160), "")
The 'Clean Data' utility in my free "Professional_Compare" workbook will do
it for you without having to use a helper column.
Download from OneDrive...
https://1drv.ms/u/s!Au8Lyt79SOuhZw2MCH7_7MuLj04?e=sAwbHU
'---
Nothing Left to Lose