Excel trim not working


G

Guest

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?
 
Ad

Advertisements

G

Guest

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.
 
H

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)))
 
G

Guest

Great! Thanks that got it

Harlan Grove said:
Anne Troy wrote...
....

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)))
 
Ad

Advertisements

Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top