clear all trailing char(32)

joemeshuggah

Board Regular
Joined
Jul 18, 2008
Messages
161
I have a list of names that have are all of the same length (51) due to a string of char 32 trailing the last letter...for example, if the name Joe were in cell A1, len(a1) returns a value of 51, due to there being 48 additonal characters after the e (all being char 32).

I need to be able to replace ONLY the trailing char 32 characters to get a vlookup to work...nothing I do seems to work. Any ideas?
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Also if they were char(160) (or anything else) and all followed the end of the name, and you don't want to use VBA you could modify this

Code:
=LEFT(A1,FIND(CHAR(160),A1,1)-1)
 
Upvote 0
In a list of names, CHAR(160) is probably not in the middle of the names, so you could probably just use a SUBSTITUTE function.

=SUBSTITUTE(A1,CHAR(160),"")
 
Upvote 0

Forum statistics

Threads
1,224,597
Messages
6,179,808
Members
452,944
Latest member
2558216095

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