Why Descriptions Look Identical but Do Not Match
Transaction descriptions copied from a statement or imported from another application can carry irregular spacing or hidden characters. Two cells can look the same on screen yet fail a lookup or a duplicate check, because one has a stray space or a control character.
Microsoft describes both TRIM and CLEAN as intended for text that comes from other applications.
TRIM: Extra Spaces
TRIM(text) "removes all spaces from text except for single spaces between words," so leading and trailing spaces go, and repeated spaces between words collapse to one. The argument can be a quoted string or a cell reference.
With a synthetic description in A2 such as " SAMPLE MARKET " (two spaces in front, three between the words, two at the end):
=TRIM(A2)This returns "SAMPLE MARKET".
CLEAN: Nonprinting Characters
CLEAN(text) removes nonprintable characters. Microsoft says it was designed to remove the first 32 nonprinting characters in 7-bit ASCII (values 0 through 31). Its example: if A2 contains =CHAR(9)&"Monthly report"&CHAR(10), then =CLEAN(A2) returns "Monthly report", stripping the tab and the line feed.
Apply it the same way:
=CLEAN(A2)What TRIM and CLEAN Do Not Remove
TRIM was designed to remove the 7-bit ASCII space character, value 32. Microsoft states that the Unicode nonbreaking space, decimal value 160 and common on web pages, is not removed by TRIM by itself.
Likewise, CLEAN does not remove some Unicode nonprinting characters (values 127, 129, 141, 143, 144 and 157). Microsoft's data-cleaning guidance says to use SUBSTITUTE to replace the higher-value Unicode characters (127, 129, 141, 143, 144, 157 and 160) with ASCII characters that TRIM and CLEAN can handle.
SUBSTITUTE(text, old_text, new_text, [instance_num]) replaces every occurrence of old_text when instance_num is omitted. CHAR(number) returns the character for a code from 1 to 255 in the character set your computer uses. Combining them for value 160:
=TRIM(CLEAN(SUBSTITUTE(A2, CHAR(160), " ")))Microsoft documents CHAR as using your computer's character set, so check on a sample cell that CHAR(160) matches the character in your data. The other listed values (127, 129, 141, 143, 144, 157) are not handled by this single formula.
Make the Result Permanent
Formulas leave the original text in place. Put the formula in a helper column, then use the cleaned column for lookups. If you need values rather than formulas, Microsoft documents copying formula results and choosing Paste Special > Values in a related article on converting text numbers.
If the transactions are still in a PDF, PDFtoRow converts bank statement PDFs to Excel or CSV and shows a free preview of the first 10 rows.
Convert Bank Statement PDFs Cleanly with PDFtoRow
Tired of fixing broken columns, corrupted dates, and numbers stored as text? PDFtoRow extracts transaction tables directly from digital PDF vector layers, preserving check numbers and outputting true numeric amounts. Statements up to 5 pages are free once per email every 24 hours. Check the 10-row preview before you download.
Frequently Asked Questions
Not by itself. Microsoft says TRIM removes the 7-bit ASCII space (value 32) and does not remove the Unicode nonbreaking space (value 160). Microsoft points to replacing it with SUBSTITUTE.
The first 32 nonprinting characters in 7-bit ASCII (values 0 through 31), such as tab and line feed. It does not remove some Unicode nonprinting characters such as 127, 129, 141, 143, 144 and 157.
It leaves single spaces between words and removes the extra ones, so only repeated spaces are collapsed.
Primary Evidence & Official References
- TRIM function — support.microsoft.com (Verified 2026-10-29). Official source documentation →
- CLEAN function — support.microsoft.com (Verified 2026-10-29). Official source documentation →
- Top ten ways to clean your data — support.microsoft.com (Verified 2026-10-29). Official source documentation →
- SUBSTITUTE function — support.microsoft.com (Verified 2026-10-29). Official source documentation →
- CHAR function — support.microsoft.com (Verified 2026-10-29). Official source documentation →
- Convert numbers stored as text to numbers in Excel — support.microsoft.com (Verified 2026-10-29). Official source documentation →