+ Reply to Thread
Results 1 to 5 of 5

Function to extract Date from String

  1. #1
    Registered User
    Join Date
    03-06-2018
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    5

    Function to extract Date from String

    Hi,

    I am trying to do a function that extracts a date from the end of a string.

    This date may have multiple formats
    d-m
    dd-m
    d/m
    d/m/yy
    mmmyy
    etc

    I have tried the below but does not work.

    Please Login or Register  to view this content.
    Can someone help?

    Thanks and regards,

    SAI

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Function to extract Date from String

    The key poitnt is that already in first loop execution you do:
    Please Login or Register  to view this content.
    so strInput becomes rightmost character of input string.
    And of course then it never can get any longer.

    Try:
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    03-06-2018
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    5

    Re: Function to extract Date from String

    Thanks for advice and answer,
    still not working though.

    As suggested, I have attached a spreadsheet with examples, desired results, and current results.

    Regards,
    SAI
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Function to extract Date from String

    Try
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    03-06-2018
    Location
    Australia
    MS-Off Ver
    2013
    Posts
    5

    Re: Function to extract Date from String

    Many thanks,
    works fine.

    S

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How can I extract a date from a string?
    By Tooley in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-06-2017, 11:21 AM
  2. VBA to extract date from string
    By saravanan1981 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 10-09-2016, 11:33 AM
  3. [SOLVED] Extract a date from a string
    By DavidNO in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 12-19-2013, 05:55 PM
  4. Extract date from string
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-01-2011, 08:39 AM
  5. Function to extract text in a string
    By anilbavaraju in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-12-2010, 01:06 PM
  6. problem with len() function to extract date from string
    By ramserp in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-24-2009, 10:26 AM
  7. extract date from string
    By kdp145 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-03-2006, 10:54 AM

Tags for this Thread

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