ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel trim not working (https://www.excelbanter.com/excel-discussion-misc-queries/31591-excel-trim-not-working.html)

Kharpo7

Excel trim not working
 
I am trying to utilize the trim function in Excel. I enter the "=trim(A2)"
and press enter but leading spaces are still present. There are three leading
spaces in front of a customer name field and several trailing that I wish to
remove without having to manually do so. I have tried formatting the cells as
text or as general with no sucess.

Each time I still get " account name "

Am I missing a step?


Anne Troy

Have you selected the cells, then hit Format-Cells, Alignment tab. Make sure
there's no indent, and that they're aligned left?
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


"Kharpo7" wrote in message
...
I am trying to utilize the trim function in Excel. I enter the "=trim(A2)"
and press enter but leading spaces are still present. There are three

leading
spaces in front of a customer name field and several trailing that I wish

to
remove without having to manually do so. I have tried formatting the cells

as
text or as general with no sucess.

Each time I still get " account name "

Am I missing a step?




Kharpo7

I didn't before you asked but now I have. For both the the origination column
and the formula column they are "General" for Text alignment and 0 for
Indent. I toggled the alignment to left, center and back to left but there
still appears to be the 3 spaces after hitting the left align button.

"Anne Troy" wrote:

Have you selected the cells, then hit Format-Cells, Alignment tab. Make sure
there's no indent, and that they're aligned left?
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


"Kharpo7" wrote in message
...
I am trying to utilize the trim function in Excel. I enter the "=trim(A2)"
and press enter but leading spaces are still present. There are three

leading
spaces in front of a customer name field and several trailing that I wish

to
remove without having to manually do so. I have tried formatting the cells

as
text or as general with no sucess.

Each time I still get " account name "

Am I missing a step?





Harlan Grove

Anne Troy wrote...
Have you selected the cells, then hit Format-Cells, Alignment tab. Make sure
there's no indent, and that they're aligned left?

....

Alignment might be a problem, but assuming the OP does know s/he's
talking about, it's more likely the 'spaces' are HTML nonbreaking
spaces (decimal character code 160) rather than ASCII spaces 9decimal
character code 32). The OP may have better luck changing the formula to

=TRIM(SUBSTITUTE(A2,CHAR(160),CHAR(32)))


Kharpo7

Great! Thanks that got it

"Harlan Grove" wrote:

Anne Troy wrote...
Have you selected the cells, then hit Format-Cells, Alignment tab. Make sure
there's no indent, and that they're aligned left?

....

Alignment might be a problem, but assuming the OP does know s/he's
talking about, it's more likely the 'spaces' are HTML nonbreaking
spaces (decimal character code 160) rather than ASCII spaces 9decimal
character code 32). The OP may have better luck changing the formula to

=TRIM(SUBSTITUTE(A2,CHAR(160),CHAR(32)))



Anne Troy

Sweet, Harlan. :)
*******************
~Anne Troy

www.OfficeArticles.com
www.MyExpertsOnline.com


"Harlan Grove" wrote in message
oups.com...
Anne Troy wrote...
Have you selected the cells, then hit Format-Cells, Alignment tab. Make

sure
there's no indent, and that they're aligned left?

...

Alignment might be a problem, but assuming the OP does know s/he's
talking about, it's more likely the 'spaces' are HTML nonbreaking
spaces (decimal character code 160) rather than ASCII spaces 9decimal
character code 32). The OP may have better luck changing the formula to

=TRIM(SUBSTITUTE(A2,CHAR(160),CHAR(32)))





All times are GMT +1. The time now is 08:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com