Convert Text to Date

thedeadzeds

Active Member
Joined
Aug 16, 2011
Messages
442
Office Version
  1. 365
Platform
  1. Windows
Hi Guys,

I have the following text in a cell which I would like to convert to a date format dd/mm/yyyy

01/Oct/2016

Is this possible?

Thanks
Craig
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
thanks steve this shows an error as per below
#VALUE!

<tbody>
</tbody>
 
Upvote 0
thanks steve this shows an error as per below
#VALUE!

<tbody>
</tbody>
Steve's formula worked for me. Do you have your date in cell A1 (which is where Steve's formula is looking for it)?

Here is another formula you can try...

=0+SUBSTITUTE(A1,"/","-")
 
Upvote 0
thanks both, I've noticed that there is a space at the start of the cell which is why this doesn't work. As soon as I delete the space at the start its fine. Is there any way to accommodate for the space?
 
Upvote 0
thanks both, I've noticed that there is a space at the start of the cell which is why this doesn't work. As soon as I delete the space at the start its fine. Is there any way to accommodate for the space?
Use the TRIM function...

=DATEVALUE(TRIM(A1))

or

=0+SUBSTITUTE(TRIM(A1),"/","-")
 
Upvote 0
To convert in place

Copy a blank cell Ctrl C
then With Paste Special use Add

Or to put the Date in another cell and assuming Text is in A1 =A1+0

If this does not work, check for extraneous characters before or after the text.
 
Upvote 0
thanks rick, i still get the value error but if I delete the space as per before it works fine
 
Upvote 0
thanks rick, i still get the value error but if I delete the space as per before it works fine
Did you get your values from a web page? If so, that is probably not a normal space (ASCII 32), rather, it is probably a non-breaking space (ASCII 160) instead. See if these work for you...

=DATEVALUE(TRIM(SUBSTITUTE(A1,CHAR(160),"")))

or

=0+SUBSTITUTE(TRIM(SUBSTITUTE(A1,CHAR(160),"")),"/","-")
 
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,164
Members
448,870
Latest member
max_pedreira

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