• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

date from text string

holmespoint

New Member
how do I pull a date from a text string where the date is not always at the same point in the text string. ie
ASNA1 P 15JAN16 28.00, I would like to get 15-jan-16
BJRI P 15APR16 35.00, I would like to get 15-apr-16.
 
Holmespoint

If the separator is always "P " then
=Datevalue(MID(A1,FIND("P ",A1)+2,7))
will work

If it isn't, try:
=DATEVALUE(MID(A1,FIND(" ",A1,FIND(" ",A1)+1)+1,7))

In both cases format the cells as dd-mmm-yy
 
Back
Top