Extract Date from line of text

  • Thread starter Thread starter loscherland
  • Start date Start date
L

loscherland

Is there any way I can extract a date from a cell containing a line o
text???

Eg:
A1: "16-02-04-Received & Completed"

How can I extract the date "16-02-04" & display it in Cell B1??
 
Hi
if your date is always at the beginning of the string and always in the
format "DD-MM-YY" try the following in B1
=LEFT(A1,8)
 
Is there any way I can extract a date from a cell containing a line of
text???

Eg:
A1: "16-02-04-Received & Completed"

How can I extract the date "16-02-04" & display it in Cell B1???

If it's always in that format, then:

=DATE(MID(A1,7,2)+1900+(--MID(A1,7,2)<30)*100,MID(A1,4,2),LEFT(A1,2))


--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top