5/25/2010,,"ITEM 1","DESCRIPTION 1",-38.15,, 5/25/2010,,"ITEM 2","DESCRIPTION 2",-36.52,, 5/26/2010,,"ITEM 3","DESCRIPTION 3",2141.04,, 5/26/2010,,"ITEM 4","DESCRIPTION 4",-264.02,, 5/27/2010,,"ITEM 5","DESCRIPTION 5",-77.52,, 5/27/2010,,"ITEM 6","DESCRIPTION 6",-774.76,, 5/27/2010,,"ITEM 7","DESCRIPTION 7",-90.00,, 5/28/2010,,"ITEM 8","DESCRIPTION 8",-4.34,, 5/28/2010,,"ITEM 9","DESCRIPTION 9",-75.83,, 5/28/2010,,"ITEM 10","DESCRIPTION 10",-77.14,, 5/31/2010,,"ITEM 11","DESCRIPTION 11",-7.91,, 5/31/2010,,"ITEM 12","DESCRIPTION 12",-3.71,, 5/31/2010,,"ITEM 13","DESCRIPTION 13",-18.25,, 5/31/2010,,"ITEM 14","DESCRIPTION 14",-26.50,, 5/31/2010,,"ITEM 15","DESCRIPTION 15",-44.00,, 6/1/2010,,"ITEM 16","DESCRIPTION 16",-86.43,, 6/1/2010,,"ITEM 17","DESCRIPTION 17",-7.95,, 6/2/2010,,"ITEM 18","DESCRIPTION 18",-6.43,, 6/2/2010,,"ITEM 19","DESCRIPTION 19",-25.75,, 5/27/2010,,"ITEM 20","DESCRIPTION 20",90.00,, 6/1/2010,,"ITEM 21","DESCRIPTION 21",0.01,,
And Microsoft Excel recognizes some of these as dates - Items 1 to 15 and 20 and formats them as mm/dd/yyyy and are left justified. However Items 16-19 and 21 it also recognizes as dates but puts them as dd/mm/yyyy format and right justifies them.
As I do not have control over the application that outputs the CSV files I have been working on formulas that will put both sets of values into the dd/mm/yyyy format (with leading zeros) format using the formula (I know this could be neater using mid):
=CONCATENATE(LEFT(RIGHT(A1,7),2),"/",IF(RIGHT(LEFT(A1,2),1)="/",CONCATENATE("0",LEFT(A1,1)),A1),"/",RIGHT(A1,4))
And it works fine for Items 1-15 and 20. But when I get to the other dates things start acting weird and I get values like 40/40184/0184 and 40/40215/0215. I removed the formatting from the cells to discover that items 1-15 and 20 held their mm/dd/yyyy format. However items 16-19 and 20 had become numbers: 40184, 40215 respectively.
I am looking for either a reason why this is happening and how to convert these numbers back to the mm/dd/yyyy format or some means to make the CSV file correctly import. I think this has something to do with julian time but any formula I found on the internet converted dates to be wrong. 10/1/2009 became 39823 and the formula
=DATE(INT(A1/1000),1,MOD(A1,1000))
was converted into 02/04/1941.
I am honestly stumped at this point.

Help


Back to top










