Converting text to Date format

rangequestion

Board Regular
Joined
Nov 21, 2016
Messages
62
Hi,

I have a column of cells with the following text format, "12/17/2015 12:00:00 AM". How can I convert this to a date with only the month and year and to ensure that Excel reads it as a date?

thanks
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Try, where A1 has the date text
Code:
=DATEVALUE(A1)
 
Upvote 0
If by only the month and year you mean the first of the month, then try

=DATE(RIGHT(LEFT(A1,FIND(" ",A1)-1),4),SUBSTITUTE(LEFT(A1,2),"/",""),1)

where A1 is a text date cell.

This will account for the format m/d/yyyy as well as mm/dd/yyyy.

Cheers
JB
 
Upvote 0
Hi You will need to format the result of DATEVALUE:

=TEXT(DATEVALUE(A1),"mm/dd")

You will need to do this in an empty column then copy that column over the column you are converting...
 
Upvote 0
Hi You will need to format the result of DATEVALUE:

=TEXT(DATEVALUE(A1),"mm/dd")

You will need to do this in an empty column then copy that column over the column you are converting...


but then it won't be seen as a date will it?

Surely it would just be Scott's answer, with cell formatting as custom number format mm/yy or mmm yyyy​ would it not?
 
Upvote 0
Are you sure your date is text?

If this returns true then you have a Excel date.
Code:
=ISNUMBER(A1)
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

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