Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Laura K
 
Posts: n/a
Default Concatenation with leading zeros

I have a column in excel (2002) of numbers with dashes in them (for example:
04-115-5-0606), and I need to take the dashes out. I'm using the
text-to-columns function, then concatenating it back into one column without
the dashes.
Some of the groupings have leading zeroes. I formatted the destination
cells for the text-to-column part to have the correct number of characters,
so they appear correct when they're split up. When I concatenate, however,
the leading zeroes disappear.
Is there a way to concatenate and keep the leading zeroes? Or is there a
btter way to do this?
Thanks!

  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

Using the original values, with the hyphens still in the text, try

=SUBSTITUTE(A1,"-","")

"Laura K" wrote:

I have a column in excel (2002) of numbers with dashes in them (for example:
04-115-5-0606), and I need to take the dashes out. I'm using the
text-to-columns function, then concatenating it back into one column without
the dashes.
Some of the groupings have leading zeroes. I formatted the destination
cells for the text-to-column part to have the correct number of characters,
so they appear correct when they're split up. When I concatenate, however,
the leading zeroes disappear.
Is there a way to concatenate and keep the leading zeroes? Or is there a
btter way to do this?
Thanks!

  #3   Report Post  
Laura K
 
Posts: n/a
Default

Thank you so much! That is *way* better!!

"Duke Carey" wrote:

Using the original values, with the hyphens still in the text, try

=SUBSTITUTE(A1,"-","")


  #4   Report Post  
Laura K
 
Posts: n/a
Default

New issue: the number without the dashes needs to replace the number with the
dashes *in the original cell*. When I used "substitue" it created a new
column with the dashless numbers.

Using the original values, with the hyphens still in the text, try

=SUBSTITUTE(A1,"-","")


  #5   Report Post  
Duke Carey
 
Posts: n/a
Default

Once you have the formulas all set up correctly, copy the entire range/column
of formulas, select the original values, and use Edit-Paste Special-Values
to replace the original values. Then delete the column with the formulas in
it.

"Laura K" wrote:

New issue: the number without the dashes needs to replace the number with the
dashes *in the original cell*. When I used "substitue" it created a new
column with the dashless numbers.

Using the original values, with the hyphens still in the text, try

=SUBSTITUTE(A1,"-","")




  #6   Report Post  
Laura K
 
Posts: n/a
Default

Thank you. That gives me exactly the result I need.

"Duke Carey" wrote:

Once you have the formulas all set up correctly, copy the entire range/column
of formulas, select the original values, and use Edit-Paste Special-Values
to replace the original values. Then delete the column with the formulas in
it.


  #7   Report Post  
David McRitchie
 
Posts: n/a
Default

Hi Laura,
If you intend to enter more "numbers" as text be sure to format
that column as text first. What you have from SUBSTITUTE will remain
as text unless you reenter it such as hitting F2 then ENTER.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Laura K" wrote in message ...
Thank you. That gives me exactly the result I need.

"Duke Carey" wrote:

Once you have the formulas all set up correctly, copy the entire range/column
of formulas, select the original values, and use Edit-Paste Special-Values
to replace the original values. Then delete the column with the formulas in
it.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CSV File - Leading Zeros Floridagal Excel Discussion (Misc queries) 2 August 6th 05 12:34 AM
Format a cell to keep leading zeros. Shadyhosta New Users to Excel 5 July 27th 05 04:37 PM
How do I force leading zeros in an Excel cell? EricKei Excel Discussion (Misc queries) 2 June 15th 05 08:28 PM
Leading zeros Paul Excel Discussion (Misc queries) 4 June 12th 05 04:04 AM
Displaying leading zeros in an Excel spreadsheet marianthelibrarian Excel Discussion (Misc queries) 1 January 25th 05 02:08 PM


All times are GMT +1. The time now is 06:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"