Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Replace last three characters

Hiya! i was wondering if there was a way to replace just the last three
characters in a cell? example i have 123456000 i would like to have instead
of the 000 a 959 so it would be 123456959? any ideas?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200802/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default Replace last three characters

try the replace function. Use use the formula helper box for the context.

=Replace()

"Phillips via OfficeKB.com" wrote:

Hiya! i was wondering if there was a way to replace just the last three
characters in a cell? example i have 123456000 i would like to have instead
of the 000 a 959 so it would be 123456959? any ideas?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200802/1


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Replace last three characters

On Tue, 12 Feb 2008 16:24:05 GMT, "Phillips via OfficeKB.com" <u27679@uwe
wrote:

Hiya! i was wondering if there was a way to replace just the last three
characters in a cell? example i have 123456000 i would like to have instead
of the 000 a 959 so it would be 123456959? any ideas?



=REPLACE(A1,LEN(A1)-2,3,959)

This returns a text string, so you may want to precede it with a double unary
to convert it back to a number:

=--REPLACE(A1,LEN(A1)-2,3,959)

If the values are always numbers, you could use this:

=INT(A1/1000)*1000+959


--ron
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Replace last three characters

thanks!!!

Ron Rosenfeld wrote:
Hiya! i was wondering if there was a way to replace just the last three
characters in a cell? example i have 123456000 i would like to have instead
of the 000 a 959 so it would be 123456959? any ideas?


=REPLACE(A1,LEN(A1)-2,3,959)

This returns a text string, so you may want to precede it with a double unary
to convert it back to a number:

=--REPLACE(A1,LEN(A1)-2,3,959)

If the values are always numbers, you could use this:

=INT(A1/1000)*1000+959

--ron


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200802/1

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
Use of Wildcard characters with replace tonuab Excel Discussion (Misc queries) 2 November 6th 09 09:39 PM
replace unicode characters shark102 Excel Programming 0 October 24th 07 08:03 AM
Replace non printable characters TonyL Excel Worksheet Functions 4 August 25th 07 01:03 PM
Replace pattern of characters Fernando Excel Discussion (Misc queries) 5 March 21st 07 09:33 PM
Replace characters with symbols Michael Excel Programming 2 October 27th 06 02:37 PM


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