Trailing Space / Format Question

G

Guest

Hey gang

I have a spreadsheet in Excel 2003 that has values imported from a Crystal
report. All the numbers have a trailing space, so I can not format them to
show dollar signs, decimals, comma seperators, etc...

I have tried to use the TRIM function, then copy/paste>Values only, but the
values only paste gives me back the trailing space.

Any ideas?
 
G

Guest

Try this formula in a help column


=--TRIM(SUBSTITUTE(A1,CHAR(160)," "))


copy and paste special as values and then use number formatting




Regards,

Peo Sjoblom
 
G

Guest

Well, this works for the numbers. But now the cells that contain text show
up as "#Value!"

Any slick way around that? If, then statement perhaps?

Thanks Peo

~hagen
 
B

Bob Phillips

=IF(ISERROR(--TRIM(SUBSTITUTE(A1,CHAR(160),"
"))),A1,--TRIM(SUBSTITUTE(A1,CHAR(160)," ")))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
G

Guest

That did it.

You guys are amazing. Thank you.

Bob Phillips said:
=IF(ISERROR(--TRIM(SUBSTITUTE(A1,CHAR(160),"
"))),A1,--TRIM(SUBSTITUTE(A1,CHAR(160)," ")))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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