Convert timestamp format to DD/MM/YYY

ollyhughes1982

Well-known Member
Joined
Nov 27, 2018
Messages
793
Office Version
  1. 365
Platform
  1. MacOS
Hi,

I have a Strava .csv file, and the timestamp column's format is: 'Jan 6, 2011, 3:59:27 PM'. I'd like to convert this to a simple 'DD/MM/YYYY' (06/01/2011).

I have been able to do this with a large amount of fiddling, adding and deleting columns and doing conversions / formulas etc., but I just wonder is there a single formula that I could use to achieve this?

Thanks in advance!

Olly.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
CSV expansion files should be imported into Excel, and not just open. When importing, the file is analyzed, in the case you can set the data type.
 
Upvote 0
CSV expansion files should be imported into Excel, and not just open. When importing, the file is analyzed, in the case you can set the data type.
Ah yes, that makes sense. I’ll try that and see if it correctly converts it. I’d still like to be able to do with a formula though, as I have had this issue in some other areas, where it isn't initially a csv
 
Upvote 0
Are there really single quotes around the value, or did you just add them in to post the question?
What I mean is do the values currently really look like this:
Excel Formula:
'Jan 6, 2011, 3:59:27 PM'
or this:
Excel Formula:
Jan 6, 2011, 3:59:27 PM
 
Upvote 0
Are there really single quotes around the value, or did you just add them in to post the question?
What I mean is do the values currently really look like this:
Excel Formula:
'Jan 6, 2011, 3:59:27 PM'
or this:
Excel Formula:
Jan 6, 2011, 3:59:27 PM
There are no quotes, they appear as in the second example
 
Upvote 0
OK, if you want to return the value as a date, so you can use it for date purposes (mathematical calculations, sorting, etc), use this formula for a value in cell A1:
Excel Formula:
=DATEVALUE(TEXTBEFORE(A1,",",2))
and then format the cell to a custom date format of "dd/mm/yyyy".

If you want to return it as text, you can use:
Excel Formula:
=TEXT(DATEVALUE(TEXTBEFORE(A1,",",2)),"dd/mm/yyyy")
 
Upvote 0
OK, if you want to return the value as a date, so you can use it for date purposes (mathematical calculations, sorting, etc), use this formula for a value in cell A1:
Excel Formula:
=DATEVALUE(TEXTBEFORE(A1,",",2))
and then format the cell to a custom date format of "dd/mm/yyyy".

If you want to return it as text, you can use:
Excel Formula:
=TEXT(DATEVALUE(TEXTBEFORE(A1,",",2)),"dd/mm/yyyy")
Thank you! brilliant.
 
Upvote 0

Forum statistics

Threads
1,223,837
Messages
6,174,927
Members
452,593
Latest member
Jason5710

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