Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Phil
 
Posts: n/a
Default Need insert a dash in between last 4 digits in text string

I have a column (TractID) that has a 10 character text string, like the
following entry: 0190003164.

First, I need to grab the last four digits (3164) of the entry, copy them to
the next column (PropertyID), then insert a dash (-) between the 3rd to last
(from the R) and the 2nd to last characters.

The data in the column will always be the same format, if that helps.

How do I do this?
  #2   Report Post  
Alok
 
Posts: n/a
Default

If the text is in A1 then enter the following formula in B1
=Mid(A1,7,2) & "-" & Mid(A1,9,2)
Alok

"Phil" wrote:

I have a column (TractID) that has a 10 character text string, like the
following entry: 0190003164.

First, I need to grab the last four digits (3164) of the entry, copy them to
the next column (PropertyID), then insert a dash (-) between the 3rd to last
(from the R) and the 2nd to last characters.

The data in the column will always be the same format, if that helps.

How do I do this?

  #3   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

=MID(A1,7,2) & "-" & RIGHT(A1,2)

another:

=TEXT(RIGHT(A1,4),"00-00")

In article ,
"Phil" wrote:

I have a column (TractID) that has a 10 character text string, like the
following entry: 0190003164.

First, I need to grab the last four digits (3164) of the entry, copy them to
the next column (PropertyID), then insert a dash (-) between the 3rd to last
(from the R) and the 2nd to last characters.

The data in the column will always be the same format, if that helps.

How do I do this?

  #4   Report Post  
Phil
 
Posts: n/a
Default

Thanks. It worked great.

"Alok" wrote:

If the text is in A1 then enter the following formula in B1
=Mid(A1,7,2) & "-" & Mid(A1,9,2)
Alok

"Phil" wrote:

I have a column (TractID) that has a 10 character text string, like the
following entry: 0190003164.

First, I need to grab the last four digits (3164) of the entry, copy them to
the next column (PropertyID), then insert a dash (-) between the 3rd to last
(from the R) and the 2nd to last characters.

The data in the column will always be the same format, if that helps.

How do I do this?

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
insert a JPEG into EXCEL 2002 mckee Excel Discussion (Misc queries) 3 March 11th 05 05:03 PM
insert picture BillGwyer Excel Discussion (Misc queries) 1 March 4th 05 06:37 PM
Insert Line Macro Spyder Excel Discussion (Misc queries) 1 March 3rd 05 12:17 AM
How to insert a repeating dash in phone numbers without dashes in. LemonLiptonTea New Users to Excel 3 February 5th 05 05:18 PM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 06:57 PM


All times are GMT +1. The time now is 04:13 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"