How does excel recognise non-specified XML data types (which look like time)?

didj

Board Regular
Joined
Feb 7, 2008
Messages
50
This is just a query, not a how to. I have some data which is exported to an XML file. When I import this into excel the time column appears to be unformatted ie: it is not formatted already as hh:mm:ss, since if it was, then when I convert that to a decimal it should give me the time value (in seconds) expressed as a fraction of 24hrs.

A quick search of XML data types reveals that if you don't specify a data type then excel imports the data as text. So this is what it looks like my XML file is doing ie: the time column is unspecified as opposed to xsd:time which I believe should be recognised by excel as hh:mm:ss

However, when I multiply by 86400 I still get the correct number in seconds. So how does excel know that the time column which it thinks is text, is actually time and then give me the right answer when I convert to seconds (and format as decimal)? I'm impressed!!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,216,030
Messages
6,128,408
Members
449,448
Latest member
Andrew Slatter

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