error clean spaces formula

Manolocs

Active Member
Joined
Mar 28, 2008
Messages
340
Hello, for some reason this formula clean one space only in the cell, I have to use the formula several times to get ride of all spaces in the cel :(. Can someone help me? Thanks in advance....
Code:
=TRIM(CLEAN(SUBSTITUTE(A1,CHAR(160)," ")))
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Sorry Caribeiro77, I did not express myself well, I have text in the cells, I need a space between each word for obvious reason, but my formula is leaving one space at the beginning of the text, I can not get rid of this space even if I use the formula again. But Thank you for the formula you show me :) will be useful in the future.
 
Upvote 0
I don't know why, you have 2 extra spaces in the beggining of each cell.....Try:

AB
1 AirAir
2 AlertingAlerting
3 Alternate Alternate
4 GroundGround
5 Ceiling.Ceiling.
6 CertificateCertificate
7 Chairman:Chairman:
8 ChangeChange
9 Clearance Limit.Clearance Limit.
10 Common Carriage.Common Carriage.
11 Control Area.Control Area.
12 TrafficTraffic
13 LargeLarge

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B1=TRIM(MID(A1,3,LEN(A1)-2))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
This formula is deleting the two first spaces of the text, if the text has only one space in front then the formula deletes the first letter of the text :(
By the way great tutorial on youtube :) very useful
 
Upvote 0
One more try....:)


Book1
AB
1AirAir
2AlertingAlerting
3AlternateAlternate
4GroundGround
5Ceiling.Ceiling.
6CertificateCertificate
7Chairman:Chairman:
8ChangeChange
9Clearance Limit.Clearance Limit.
10Common Carriage.Common Carriage.
11Control Area.Control Area.
12TrafficTraffic
13LargeLarge
Sheet1
Cell Formulas
RangeFormula
B1=IFERROR(TRIM(MID(A1,FIND(CHAR(160),A1)+1,LEN(A1)-1)),A1)
 
Upvote 0
;( did not work, same as before the spaces are still there. Did you manage to make work in the spreadsheet I sent?
 
Upvote 0
In the formula you have in your workbook, what looks like a space in the SUBSTITUTE function is actually a non-breaking space, so it does nothing:

=TRIM(CLEAN(SUBSTITUTE(A1,CHAR(160),"*")))

That asterisk is how an NBS appears in the forum.

Fix that and it works fine.
 
Upvote 0

Forum statistics

Threads
1,216,102
Messages
6,128,851
Members
449,471
Latest member
lachbee

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