Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Find and Replace only the first character

I am trying to replace only the first number in a date.
example: 6/6/10 with 7/6/10
I am doing a find 6/ and a replace 7/ but it changes the 7/6 to 7/7 and I
only want to look at the first number in the date. Can anyone help me????
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 457
Default Find and Replace only the first character

Use the 4th arguement to state that you only want to change the first
instance.

=SUBSTITUTE(A2,"6","7",1)

This premise does assume that you have dates stored as text. If you have
them stored as numbers (preferred), you can do:
=DATE(YEAR(A2),7,DAY(A2))

--
Best Regards,

Luke M
"Terry Willard" <Terry wrote in message
...
I am trying to replace only the first number in a date.
example: 6/6/10 with 7/6/10
I am doing a find 6/ and a replace 7/ but it changes the 7/6 to 7/7 and I
only want to look at the first number in the date. Can anyone help me????



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 342
Default Find and Replace only the first character

Assuming that your date format is Month, Day, Year you could use the
following formula to compute the change from June to July. Other months
would not be affected.

First, assuming your original date is in cell A2, put this formula in Cell B2:
=IF(MONTH(A2)=6,DATE(YEAR(A2),7,DAY(A2)),A2)

Next, Paste-Special-Values from Cell B2 to Cell A2. Then you can clear the
contents of Cell B2.

Tom

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Find and Replace only the first character

Thank you so much! This was VERY helpful!!!!!

"tompl" wrote:

Assuming that your date format is Month, Day, Year you could use the
following formula to compute the change from June to July. Other months
would not be affected.

First, assuming your original date is in cell A2, put this formula in Cell B2:
=IF(MONTH(A2)=6,DATE(YEAR(A2),7,DAY(A2)),A2)

Next, Paste-Special-Values from Cell B2 to Cell A2. Then you can clear the
contents of Cell B2.

Tom

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
more character 160 leading/trailing find/replace problems M Excel Discussion (Misc queries) 6 October 31st 08 11:06 AM
find replace the 1st character in a cell Pete Excel Discussion (Misc queries) 2 March 31st 08 07:27 AM
find a replace character question jimmc Excel Discussion (Misc queries) 3 January 19th 07 10:47 PM
find a character and replace with a command in Excel Jo Excel Discussion (Misc queries) 1 June 27th 06 12:50 PM
How do you find and replace a Wildcard character in Excel? Wildcard Excel Discussion (Misc queries) 8 August 18th 05 01:18 AM


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