How to make Excel recognise Dukascopy date time format - excel

I'm working with a date and time format from the Dukascopy csv download format. It looks like this:
01.03.2018 07:00:00.000 GMT-0000.
Is there a formula to convert this to a format that could be sorted chronologically? I don't need the -0000, just the date and time. Thank you.

Please try:
=DATE(MID(A1,7,4),MID(A1,4,2),MID(A1,1,2))+TIMEVALUE(MID(A1,12,12))
with formatting to suit.
Switch around the second and third parameters of DATE (the 4 and the 1) to suit the date convention of your source, if required.

try this:
=--SUBSTITUTE(LEFT(A1,20),".","/")
Then format as desired.
This only works if the input and the local settings agree as to order of MM/DD or DD/MM.

Related

In Excel how do I format cells correctly to work with the following date/time format?

Could someone please tell me what cell format I should use to format the following so that they are recognised in a date time format I can then use to sort from oldest date to newest date please?
02-DEC-21 21.32.01.666000000
02-DEC-21 22.16.50.588000000
03-DEC-21 00.31.06.414000000
03-DEC-21 03.50.11.644000000
03-OCT-21 18.04.41.267000000
04-DEC-21 05.39.27.832000000
I’ve tried using dd-mmm-yy hh.mm.ss.000 (can’t enter more than three 0’s in milliseconds) and also without the .000 at the end but the cells don’t get recognised as dates when I try and sort them
Thanks
You can use two formulas to retrieve the date part and the time part.
I named the range with the dates DateColumn
To retrieve the date part: =DATEVALUE(SUBSTITUTE(LEFT(DateColumn,9),".",":"))
To retrieve the time part: =TIMEVALUE(SUBSTITUTE(MID(DateColumn,11,8),".",":"))
To retrieve the whole date incl. time:
=DATEVALUE(SUBSTITUTE(LEFT(DateColumn,9),".",":")) + TIMEVALUE(SUBSTITUTE(MID(DateColumn,11,8),".",":"))
These formulas return a number, e.g. 44532 for 02-DEC-21 or 0,92835648 for 22.16.50 or 44532,92835648 for the whole date with time. You have to format them accordingly.
But be aware: this will only work on an english system.
E.g. on a German system only Dez or Okt would get recognized.

Separate date and time in Excel

I need to separate the date and time for a large list of data in Excel, the format is 12/23 1600 (i.e. 23 December 16:00).
I tried the function =DATE(YEAR(serial_number),MONTH(serial_number),DAY(serial_number)), but it couldn't read that format.
Could you please tell me how to do that without change the format?
This works for me as I see your data
=DATE(YEAR(TODAY()),LEFT(A2,2),MID(A2,4,2))
and
=TIME(INT(MID(A2,FIND(" ",A2)+1,9)/100),MOD(MID(A2,FIND(" ",A2)+1,9)/100,1)*100,0)
If the data is a string, AND IF your windows short date regional format is MDY, then try:
=DATEVALUE(LEFT(A1,FIND(" ",A1)-1))
If the data is a "real" date, formatted to appear as you show, then try:
=INT(A1)
In either case, be sure to format the result as you desire.
If your Windows regional settings are other than MDY, then you can use this more complex formula:
=DATE(YEAR(TODAY()), LEFT(A1,FIND("/",A1)-1),MID(LEFT(A1,FIND(" ",A1)-1),FIND("/",A1)+1,2))
For the time portion, you can try
=TIMEVALUE(REPLACE(RIGHT(A1,4),3,0,":"))
If the above does not work, then provide more information about exactly what is in the cell, your regional format, etc.

When uploading Excel file with a date, it looks like '41851'', not '7/31/2014'

When uploading an Excel file in Web Dynpro for ABAP with date, the date looks like 41851 instead of 7/31/2014.
How can I solve this problem?
Excel stores Dates as numbers. To display that number as Date as you know it, format the cell as Date cell.
Use this formula =TEXT(41851,"YYYY-mm-dd") and the date should upload correctly (you can change the format string to whatever you need).
I found solution:
data: lv_data type sy-datum,
lv_startdate type sy-datum.
lv_startdate = '19000101'. "starting date(excel parameter)
lv_data = lv_startdate + 41851(the date from excel that we need to convert to normal date) - 2.
write lv_data.
this code works, thx all for help.

Date format YYYY-MM-DD+11:00 convert in to YYY-MM-DD HH:MM:SS

I Received excel data with following format
Date format YYYY-MM-DD+11:00 (Ex 2014-02-15+11:00 /2014-02-18+13:00)
Now I need to convert into this format
2014-02-18 HH:MM:SI
Please help me to do this
cheers
Just did a quick test. It's a little sloppy, but this formula will work. For the sake of argument, it assumes that the data you're trying to convert is in A1 of the current sheet, that it's all the same length, and that the format is "General":
=SUM(DATEVALUE(LEFT(A1,10)),TIMEVALUE(RIGHT(A1,5)))
Wherever you use the above formula, change the format to the Custom Format YYYY-MM-DD HH:MM:SI. I'm not sure what you're looking for with SI. I'm taking that literally. That custom format will display the seconds value and then the letter I. If you're looking for a different value, like milliseconds, then you can look that up. But if the data you're converting is in a "General" format, when you convert it, it won't have seconds or milliseconds, anyway. Those will all get converted to 00s.

Formatting Date(YY:MM:DD:Time) in Excel

I have an excel file, with a date column, but I want to convert the date column to
YY/MM/DD/Time
Ive been searching for 2 hours and no result yet.
This is my data:
Source Data: http://i.stack.imgur.com/75zbS.jpg
Expected Output: YY/MM/DD/Time
Can someone help me how I can do it? I want to insert it into postgresql and I want to change everything to compatible date format.
EDIT: I have tried Right Click -> Format cells -> date but it does not change anything!
Thanks
You could use this method and split the date and time into separate cells:
=DATE((LEFT(A1,4)),(MID(A1,5,2)),MID(A1,7,2))
=TIME(MID(A1,10,2),(MID(A1,12,2)),0)
Once your date value is in a format Excel can recognize, you can then change the formatting to whatever you'd like.
Or if you don't care to have the value in a recognizable date format, you can just get your desired formatting like this (will give you a string that looks like this: YY/MM/DD/Time):
=MID(A1,3,2)&"/"&MID(A1,5,2)&"/"&MID(A1,7,2)&"/"&MID(A1,10,4)
ISO 8601 format would be YYYY-MM-DD H24:MI:SS.
But you can set Postgres to accept various date styles by setting the datestyle setting. You can do that globally in postgresql.conf or temporarily for your session.
SET datestyle = SQL, DMY
For more exotic formats, you can create a temporary staging table, COPY to it and INSERT into your target table from there. Among others, you can use to_timestamp():
SELECT to_timestamp('13/10/14/17:33', 'YY/MM/DD/hh24:mi')
More info and example code in related answers like these:
Replacing whitespace with sed in a CSV (to use w/ postgres copy command)
How to bulk insert only new rows in PostreSQL
Your going to have to parse the date into four columns using fixed parsing.
Then reassemble the columns any way you want.
Just Google with excel parse columns fixed.

Resources