Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Faio
 
Posts: n/a
Default Separate 5digits by inserting -

I have a column containing codes and I wish to separate the first digit from
the rest by inserting a hyphen.
E.g 40000 to be 4-0000, 40001 to 4-0001.

Any suggestions rather than going thru a list of more than 1000s?




  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Separate 5digits by inserting -

Hi!

Use a temporary helper column.

Suppose your data is now in the range A1:A1000.

Enter this formula in B1 and copy down to B1000:

=LEFT(A1)&"-"&MID(A1,2,255)

Select the range of formulas in B1:B1000
Goto EditCopy
Then EditPaste SpecialValuesOK

Then you can delete the original data if you'd like.

Biff

"Faio" wrote in message
...
I have a column containing codes and I wish to separate the first digit
from
the rest by inserting a hyphen.
E.g 40000 to be 4-0000, 40001 to 4-0001.

Any suggestions rather than going thru a list of more than 1000s?






  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default Separate 5digits by inserting -

If they are all 5 digit numbers.........

=LEFT(A1,1)&"-"&RIGHT(A1,4)


Gord Dibben Excel MVP

On Thu, 1 Dec 2005 13:59:09 +1200, "Faio" wrote:

I have a column containing codes and I wish to separate the first digit from
the rest by inserting a hyphen.
E.g 40000 to be 4-0000, 40001 to 4-0001.

Any suggestions rather than going thru a list of more than 1000s?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Separate 5digits by inserting -

On Thu, 1 Dec 2005 13:59:09 +1200, "Faio" wrote:

I have a column containing codes and I wish to separate the first digit from
the rest by inserting a hyphen.
E.g 40000 to be 4-0000, 40001 to 4-0001.

Any suggestions rather than going thru a list of more than 1000s?




Are they all 5 digit numbers?

If so:

=TEXT(a1, "0-0000")

and copy/drag down as needed.


--ron
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Faio
 
Posts: n/a
Default Separate 5digits by inserting -

Thanks Biff, Dibben and Rosenfeld.

What you gave has solved this problem in seconds rather than hours.


"Ron Rosenfeld" wrote in message
...
On Thu, 1 Dec 2005 13:59:09 +1200, "Faio" wrote:

I have a column containing codes and I wish to separate the first digit

from
the rest by inserting a hyphen.
E.g 40000 to be 4-0000, 40001 to 4-0001.

Any suggestions rather than going thru a list of more than 1000s?




Are they all 5 digit numbers?

If so:

=TEXT(a1, "0-0000")

and copy/drag down as needed.


--ron



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
Separate first and second name in one cell into separate cells. Dwight in Georgia Excel Discussion (Misc queries) 3 January 25th 06 09:09 PM
Open Excel files in separate sessions, not just separate windows? Bob at Dexia Design Excel Discussion (Misc queries) 1 October 18th 05 05:46 PM
Separate Groups by Inserting Lines ConfusedNHouston Excel Discussion (Misc queries) 2 October 17th 05 03:49 PM
Open separate window Robbin Excel Worksheet Functions 2 September 1st 05 01:03 PM
Separate first and second name in one cell into separate cells. Gary's Student Excel Discussion (Misc queries) 0 April 27th 05 11:11 PM


All times are GMT +1. The time now is 02:34 PM.

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

About Us

"It's about Microsoft Excel"