Convert Text date to date

HealthonCall

New Member
Joined
Sep 19, 2018
Messages
4
Hi,

I have a survey which outputs a csv file. In one of the fields it returns

August 3, 2018 10:58 AM - Text field


I am wanting to convert it in a table to date format, I have tried =date(cell) but it does not seem to work... any ideas?

Thanks
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Welcome to the MrExcel board!
Try
=LEFT(REPLACE(SUBSTITUTE(A1,",",LEFT(A1,FIND(" ",A1))),1,FIND(" ",A1),""),LEN(A1)-9)+0

or
=DATEVALUE(SUBSTITUTE(MID(SUBSTITUTE(A1," ",REPT(" ",20)),20,40),",",LEFT(A1,3)))
 
Last edited:
Upvote 0
Hi Peter,

That is putting the data in the correct order in ie returning 03/08/2018 ... however if I do a column next to it and reference it using =YEAR(cell) it returns
10/07/1905 ??

Any idea?

Thanks

Chris
 
Upvote 0
however if I do a column next to it and reference it using =YEAR(cell) it returns
10/07/1905 ??

Any idea?
All you would have to do is format that cell/column as Number instead of Date. Dates in Excel are just whole numbers starting from 1 January 1900. Your YEAR() formula was correctly returning 2018, but because your cell was formatted as Date it was showing 10 July 1905 as that is 2018 days counting from 1 January 1900. :)

Your other solution is fine so long as you are happy with a Text value of "2018" rather than the Number 2018.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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