Convert timestamp format to DD/MM/YYY

ollyhughes1982

Well-known Member
Joined
Nov 27, 2018
Messages
795
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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hello! Do you import this file or just open in the program?
 
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.
 
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
You are welcome.
Glad we were able to help!
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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