need help in Trim

sksanjeev786

Well-known Member
Joined
Aug 5, 2020
Messages
1,004
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi Team

I have written the Trim function in both the cell still getting false

book1
HIJKLM
22AFAM W2TF v1 15sAFAM W2TF v1 15s FALSE
Sheet2
Cell Formulas
RangeFormula
M22M22=TRIM(H22)=TRIM(J22)
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Works fine here, maybe you have non breaking spaces in that string --> char(160)
 
Upvote 0
Works fine here, maybe you have non breaking spaces in that string --> char(160)
Yes! this is only 1 extra space so I have written the Trim so technically it should work.

i just removed 1 space from my file then it came True... so for extra space, we usually use the Trim function...

and yes when I copied this in another file I got Truee but on my data file so how to rectify this... with in my data file.
 
Upvote 0
Yes but the Trim function will not remove "non-breaking spaces"

A space is char(32)
Non breaking space is char(160)

so if it machtes with this formula, it is present

Excel Formula:
=search(char(160),H22)
 
Upvote 0
Yes but the Trim function will not remove "non-breaking spaces"

A space is char(32)
Non breaking space is char(160)

so if it machtes with this formula, it is present

Excel Formula:
=search(char(160),H22)
but i am not able to perform the True condition for both data if it same:)
 
Upvote 0
The function JEC gave you is just meant to determine if character code 160 is the issue, use the formula on both H22 & J22 and show us what it returns.
Aternatively try:
Excel Formula:
=TRIM(SUBSTITUTE(H22,CHAR(160),""))=TRIM(SUBSTITUTE(J22,CHAR(160),""))
 
Upvote 0
Can you share the file or a sample where you get the error, so we can have a look?
Upload to a cloud storage and share the link here
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,635
Members
452,661
Latest member
Nonhle

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top