Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Lisa
 
Posts: n/a
Default Find/Replace 4 numbers in a sting of 17

How can I use find and replace to change four consecutive zeros to 1135 with
out changing the rest of the number?
EX: 01000010100012711

Change to: 01113510100012711
Any suggestions would be greatly appreciated.
  #2   Report Post  
Dave O
 
Posts: n/a
Default

This formula did it for me:
=IF(NOT(ISERROR(FIND("0000",A1,1))),MID(A1,1,FIND( "0000",A1,1)-1)&"1135"&MID(A1,FIND("0000",A1,1)+4,LEN(A1)),A1)

This evaluates the entry in cell A1. If it finds a series of four
zeroes it parses the entry and replaces the four zeros with 1135. If
four consecutive zeroes are not found, it returns the value in A1.

Is it possible that 2 separate strings of four zeroes may appear? If
yes you'll need to run a similar formula on your *new* entries, as
well.

  #3   Report Post  
Lisa
 
Posts: n/a
Default

It works like a champ, you are a genius! Thanks, I'd have never figured that
out.

"Dave O" wrote:

This formula did it for me:
=IF(NOT(ISERROR(FIND("0000",A1,1))),MID(A1,1,FIND( "0000",A1,1)-1)&"1135"&MID(A1,FIND("0000",A1,1)+4,LEN(A1)),A1)

This evaluates the entry in cell A1. If it finds a series of four
zeroes it parses the entry and replaces the four zeros with 1135. If
four consecutive zeroes are not found, it returns the value in A1.

Is it possible that 2 separate strings of four zeroes may appear? If
yes you'll need to run a similar formula on your *new* entries, as
well.


  #4   Report Post  
Lisa
 
Posts: n/a
Default

Thanks Dave, I am going to give it a try.

"Dave O" wrote:

This formula did it for me:
=IF(NOT(ISERROR(FIND("0000",A1,1))),MID(A1,1,FIND( "0000",A1,1)-1)&"1135"&MID(A1,FIND("0000",A1,1)+4,LEN(A1)),A1)

This evaluates the entry in cell A1. If it finds a series of four
zeroes it parses the entry and replaces the four zeros with 1135. If
four consecutive zeroes are not found, it returns the value in A1.

Is it possible that 2 separate strings of four zeroes may appear? If
yes you'll need to run a similar formula on your *new* entries, as
well.


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

One way, using a formula:

This assumes that you only want to change the first instance of 0000.

=SUBSTITUTE(A1,"0000","1135",1)

In article ,
"Lisa" wrote:

How can I use find and replace to change four consecutive zeros to 1135 with
out changing the rest of the number?
EX: 01000010100012711

Change to: 01113510100012711
Any suggestions would be greatly appreciated.

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
Seed numbers for random number generation, uniform distribution darebo Excel Discussion (Misc queries) 3 April 21st 23 10:02 PM
Sorting when some numbers have a text suffix confused on the tundra Excel Discussion (Misc queries) 5 December 18th 04 11:19 PM
Sorting imported "numbers" Confused on the tundra Excel Discussion (Misc queries) 5 December 17th 04 08:33 PM
Paste rows of numbers from Word into single Excel cell BecG Excel Discussion (Misc queries) 1 December 8th 04 05:55 PM
I enter numbers and they are stored as text burkeville Excel Discussion (Misc queries) 5 December 3rd 04 02:59 AM


All times are GMT +1. The time now is 05:43 AM.

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"