+ Reply to Thread
Results 1 to 5 of 5

search and replace the final 2 digits

  1. #1
    Registered User
    Join Date
    03-18-2011
    Location
    Dayton, ME, USA
    MS-Off Ver
    Excel 2004 for MAC 11.5.4
    Posts
    77

    search and replace the final 2 digits

    Hi

    I have a large file in which dates have been entered incorrectly, but only the year.

    I have in col L for example 23-Jan-15 how do I search this column and replace the last 2 digits as follows:- if they are 15 they need to replace with 11 and if they are 14 they need to replace with 10.

    Obviously a standard search and replace will not work as it would replace any days (first 2 digits) that are 14 and 15 also.

    Have been trying things for a couple of hours with no success.

    Any help is appreciated.

    Regards

    Jon
    Last edited by endoskeleton; 05-23-2011 at 02:52 PM.

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: search and replace the final 2 digits

    Set up a new column and put in this formula, then copy down:
    Please Login or Register  to view this content.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    03-18-2011
    Location
    Dayton, ME, USA
    MS-Off Ver
    Excel 2004 for MAC 11.5.4
    Posts
    77

    Re: search and replace the final 2 digits

    Hi Dave

    Many thanks for that, unfortunately it does not seem to work.

    It is copying the date exactly and not changing the 14 to 10 or the 15 to 11

    The original cell" L2" 21-Feb-14 resulting cell "M2" 21-Feb-14

    Any ideas?

    Jon

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: search and replace the final 2 digits

    Oh, I see you are using Mac. Mac uses the 1904 date system, whereas Windows based Excel uses the 1900 date system. Because of this, the two numbers in the formula, 42005 and 41640 are off. To find out what those numbers should be, type in 1/1/2015 and 1/1/2014 into two cells, then change the format of those cells to number.

  5. #5
    Registered User
    Join Date
    03-18-2011
    Location
    Dayton, ME, USA
    MS-Off Ver
    Excel 2004 for MAC 11.5.4
    Posts
    77

    Re: search and replace the final 2 digits

    Hi Dave

    That's great - thankyou so much

    Jon

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1