Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pm pm is offline
external usenet poster
 
Posts: 122
Default inserting a dash into a column of numbers

Hello all. I would like to insert a "-" into a column of numbers after the
5th digit each time. The 1st 5 digits will not always be the same, obviously
and there are either 6 or 7 digits total in each number.

I was trying to do this via find and replace, but I can't seem to figure out
a good way.

For example: 7000111 I would like to be 70001-11

Thanks in advance!!!!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 142
Default inserting a dash into a column of numbers

=IF(LEFT(A1,5)<"",LEFT(A1,3)&"-"&RIGHT(A1,2))

"pm" wrote:

Hello all. I would like to insert a "-" into a column of numbers after the
5th digit each time. The 1st 5 digits will not always be the same, obviously
and there are either 6 or 7 digits total in each number.

I was trying to do this via find and replace, but I can't seem to figure out
a good way.

For example: 7000111 I would like to be 70001-11

Thanks in advance!!!!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default inserting a dash into a column of numbers

LEFT(A1,5) instead of LEFT(A1,3)

"ufo_pilot" wrote:

=IF(LEFT(A1,5)<"",LEFT(A1,3)&"-"&RIGHT(A1,2))

"pm" wrote:

Hello all. I would like to insert a "-" into a column of numbers after the
5th digit each time. The 1st 5 digits will not always be the same, obviously
and there are either 6 or 7 digits total in each number.

I was trying to do this via find and replace, but I can't seem to figure out
a good way.

For example: 7000111 I would like to be 70001-11

Thanks in advance!!!!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pm pm is offline
external usenet poster
 
Posts: 122
Default inserting a dash into a column of numbers

Thanks, but is there a way to account for the fact that there are either 1 or
2 digits to the right of the dash?

Thanks for the formulas guys...I'm way farther now than I was


"Teethless mama" wrote:

LEFT(A1,5) instead of LEFT(A1,3)

"ufo_pilot" wrote:

=IF(LEFT(A1,5)<"",LEFT(A1,3)&"-"&RIGHT(A1,2))

"pm" wrote:

Hello all. I would like to insert a "-" into a column of numbers after the
5th digit each time. The 1st 5 digits will not always be the same, obviously
and there are either 6 or 7 digits total in each number.

I was trying to do this via find and replace, but I can't seem to figure out
a good way.

For example: 7000111 I would like to be 70001-11

Thanks in advance!!!!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
pm pm is offline
external usenet poster
 
Posts: 122
Default inserting a dash into a column of numbers

Nevermind, I just sorted by digits and I got it to work by tweaking 1 or 2 in
the formula. Thanks guys!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default inserting a dash into a column of numbers

Something like this:

=IF(LEN(A1)5,LEFT(A1,5)&"-"&RIGHT(A1,LEN(A1)-5),A1&"-")

Hope this helps.

Pete

pm wrote:
Thanks, but is there a way to account for the fact that there are either 1 or
2 digits to the right of the dash?

Thanks for the formulas guys...I'm way farther now than I was


"Teethless mama" wrote:

LEFT(A1,5) instead of LEFT(A1,3)

"ufo_pilot" wrote:

=IF(LEFT(A1,5)<"",LEFT(A1,3)&"-"&RIGHT(A1,2))

"pm" wrote:

Hello all. I would like to insert a "-" into a column of numbers after the
5th digit each time. The 1st 5 digits will not always be the same, obviously
and there are either 6 or 7 digits total in each number.

I was trying to do this via find and replace, but I can't seem to figure out
a good way.

For example: 7000111 I would like to be 70001-11

Thanks in advance!!!!


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 618
Default inserting a dash into a column of numbers

=LEFT(A1,5)&"-"&MID(A1,6,2)
--
David Biddulph

"pm" wrote in message
...
Thanks, but is there a way to account for the fact that there are either 1
or
2 digits to the right of the dash?

Thanks for the formulas guys...I'm way farther now than I was


"Teethless mama" wrote:

LEFT(A1,5) instead of LEFT(A1,3)

"ufo_pilot" wrote:

=IF(LEFT(A1,5)<"",LEFT(A1,3)&"-"&RIGHT(A1,2))

"pm" wrote:

Hello all. I would like to insert a "-" into a column of numbers
after the
5th digit each time. The 1st 5 digits will not always be the same,
obviously
and there are either 6 or 7 digits total in each number.

I was trying to do this via find and replace, but I can't seem to
figure out
a good way.

For example: 7000111 I would like to be 70001-11

Thanks in advance!!!!



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
Conditional Format as a MACRO Gunjani Excel Worksheet Functions 3 March 29th 06 05:22 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Count comma separated numbers, numbers in a range with dash, not t Mahendra Excel Discussion (Misc queries) 0 August 8th 05 05:56 PM
Consecutive Numbers down a column not to Exceed 49 Nelson Excel Worksheet Functions 6 July 18th 05 09:32 PM
Return Count for LAST NonBlank Cell in each Row Sam via OfficeKB.com Excel Worksheet Functions 12 April 17th 05 10:36 PM


All times are GMT +1. The time now is 04:10 AM.

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"