String to date?

eduzs

Well-known Member
Joined
Jul 6, 2014
Messages
704
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
IS there a formula to get the date from a string like that: "wedsneday, 14 of june of 2016"??
Thanks
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Sure, but it won't be very pretty. Assuming that you have multiple text dates that you want to convert to excel recognized dates, are they all in that same format?
 
Upvote 0
Hello try this formula:

convert%20date%20to%20text.png
 
Upvote 0
IS there a formula to get the date from a string like that: "wedsneday, 14 of june of 2016"??
Give this formula a try...

=0+MID(SUBSTITUTE(LOWER(A1),"of ",""),FIND(" ",A1)+1,99)

This formula returns the date's serial number so you will need to apply the Date Cell Format of your choice to the cell you put it in.
 
Upvote 0
Give this formula a try...

=0+MID(SUBSTITUTE(LOWER(A1),"of ",""),FIND(" ",A1)+1,99)

This formula returns the date's serial number so you will need to apply the Date Cell Format of your choice to the cell you put it in.

I have tried your formula and another of mine, it works fine up until it has to sum the 0, basically, its doing "0+ 14 june 2016" which is returning #VALUE, any idea how to approach this?
 
Upvote 0
I have tried your formula and another of mine, it works fine up until it has to sum the 0, basically, its doing "0+ 14 june 2016" which is returning #VALUE, any idea how to approach this?
Are you saying the formula I posted is not working for you? Did you use it exactly like I posted it (except for changing the cell reference is your date string is not in cell A1)? Just so you know, the formula I posted works fine for me.
 
Upvote 0
Correct. I'm trying exactly the one you posted, same reference, "wedsneday, 14 of june of 2016"(no quotes) in A1, and it's returning #Value!
 
Last edited:
Upvote 0
Correct. I'm trying exactly the one you posted, same reference, "wedsneday, 14 of june of 2016"(no quotes) in A1, and it's returning #Value!
Maybe your spaces are not actually "spaces" (ASCII 32)... if you got your data from the web, there is a good chance they are non-breaking spaces (ASCII 160). See if this version of my formula works for you...

=0+MID(SUBSTITUTE(LOWER(SUBSTITUTE(A1,CHAR(160)," ")),"of ",""),FIND(" ",SUBSTITUTE(A1,CHAR(160)," "))+1,99)
 
Upvote 0

Forum statistics

Threads
1,214,540
Messages
6,120,107
Members
448,945
Latest member
Vmanchoppy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top