ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Problems with number formats when using Find/Replace (https://www.excelbanter.com/excel-discussion-misc-queries/101460-problems-number-formats-when-using-find-replace.html)

Bill

Problems with number formats when using Find/Replace
 
I have a list of numbers formatted as text, for instance 1648-50, 1648-56,
0932-73, etc.

When I run the Replace function, trying to replace all the dashes with
periods (while keeping the same format--because I need the leading zeroes),
this happens:

0932-73 becomes 932.73, 1648-50 becomes 1648.5, and so on.

When I check the formatting of the cells, they're all still listed as
"Text", and this happens even if I specify that the number format of the
replacement should be text. What's the deal? Is there any way to keep this
from happening?

Dave Peterson

Problems with number formats when using Find/Replace
 
Are these in a single column?

If yes, then I'd insert an adjacent column and use a formula:

=substitute(a1,"-",".")

This will keep the value a string.

You can edit|copy, edit|paste special|values and delete the original column if
you want.

bill wrote:

I have a list of numbers formatted as text, for instance 1648-50, 1648-56,
0932-73, etc.

When I run the Replace function, trying to replace all the dashes with
periods (while keeping the same format--because I need the leading zeroes),
this happens:

0932-73 becomes 932.73, 1648-50 becomes 1648.5, and so on.

When I check the formatting of the cells, they're all still listed as
"Text", and this happens even if I specify that the number format of the
replacement should be text. What's the deal? Is there any way to keep this
from happening?


--

Dave Peterson

Bill

Problems with number formats when using Find/Replace
 
that worked perfectly.

thanks a lot!

"Dave Peterson" wrote:

Are these in a single column?

If yes, then I'd insert an adjacent column and use a formula:

=substitute(a1,"-",".")

This will keep the value a string.

You can edit|copy, edit|paste special|values and delete the original column if
you want.

bill wrote:

I have a list of numbers formatted as text, for instance 1648-50, 1648-56,
0932-73, etc.

When I run the Replace function, trying to replace all the dashes with
periods (while keeping the same format--because I need the leading zeroes),
this happens:

0932-73 becomes 932.73, 1648-50 becomes 1648.5, and so on.

When I check the formatting of the cells, they're all still listed as
"Text", and this happens even if I specify that the number format of the
replacement should be text. What's the deal? Is there any way to keep this
from happening?


--

Dave Peterson


MAJones

Problems with number formats when using Find/Replace
 
You can also use custom formatting to get you leading zeroes

"bill" wrote:

I have a list of numbers formatted as text, for instance 1648-50, 1648-56,
0932-73, etc.

When I run the Replace function, trying to replace all the dashes with
periods (while keeping the same format--because I need the leading zeroes),
this happens:

0932-73 becomes 932.73, 1648-50 becomes 1648.5, and so on.

When I check the formatting of the cells, they're all still listed as
"Text", and this happens even if I specify that the number format of the
replacement should be text. What's the deal? Is there any way to keep this
from happening?



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

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