SOLVED
Home

How to convert date format from imported data?

%3CLINGO-SUB%20id%3D%22lingo-sub-69534%22%20slang%3D%22en-US%22%3EHow%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-69534%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20csv%20file%20exported%20from%20another%20program%20with%20a%20column%20of%20dates.%20Excel%20recognizes%20the%20data%20as%20dates%20but%20it%20converts%20them%20to%20the%20wrong%20format.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20problem%20is%20the%20date%20March%2027%2C%202017%20shows%20up%20as%202027-03-17.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20convert%20those%20dates%20to%2027-Mar-2017%20or%20something%20correct%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20tried%20using%20%22text%20to%20columns%22%20but%20it%20didn't%20work.%20Maybe%20I'm%20doing%20something%20wrong......%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-69534%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-207457%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-207457%22%20slang%3D%22en-US%22%3E%3CP%3EExcel%20will%20not%20format%20my%20date%20that's%20being%20pulled%20from%20my%20program%20(this%20is%20a%20csv%20file).%26nbsp%3B%20I%20have%20never%20had%20an%20issue%20with%20this%20until%20a%20couple%20days%20ago.%26nbsp%3B%20Date%20will%20read%20512017%20which%20needs%20to%20be%20formatted%20to%2005012018%20(mmddyyyy%20or%20mm%2Fdd%2Fyyyy)%20I've%20come%20close%20to%20getting%20the%20proper%20format%20however%2C%20Excel%20changes%20my%20data%20to%20completely%20different%20numbers.%26nbsp%3B%20How%20do%20I%20fix%20this%20issue%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%20Michelle%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-192969%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-192969%22%20slang%3D%22en-US%22%3E%3CP%3EThat%20feels%20much%20better-%20I%20stopped%20hitting%20my%20head%20against%20the%20wall.%26nbsp%3B%20I%20discovered%20the%20problem%3A%20the%20system%20settings%20were%20not%20in%20synch%20with%20the%20date%20format%20in%20Excel.%26nbsp%3B%20Once%20I%20changed%20the%20system%20format%2C%20everything%20was%20okay!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHave%20a%20good%20day.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFrank%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-192887%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-192887%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20late%20to%20this%20dance%20but%20I%20have%20a%20similar%20problem%20to%20that%20which%20has%20been%20discussed%20here.%20While%20mine%20seems%20to%20be%20easier%2C%20I%20am%20still%20banging%20my%20head%20against%20the%20wall.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20attached%20a%20file.%20%26nbsp%3BIn%20Column%20G%20(second%20column)%2C%20there%20is%20original%20text.%20%26nbsp%3BI%20removed%20unnecessary%20data%20and%20this%20is%20presented%20in%20the%20first%20column.%20%26nbsp%3BIt%20should%20be%20a%20simple%20process%20to%20convert%20the%20text%20to%20a%20date%20using%20%3D%2Bdatevalue(B1)%20which%20I%20tried%20and%20the%20result%20is%20in%20the%20the%20third%20column.%20As%20you%20can%20see%2C%20it%20returned%20a%20%23VALUE!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestions%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKind%20regards%2C%3C%2FP%3E%3CP%3EFrank%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-192886%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-192886%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20late%20to%20this%20dance%20but%20I%20have%20a%20similar%20problem%20to%20that%20which%20has%20been%20discussed%20here.%20While%20mine%20seems%20to%20be%20easier%2C%20I%20am%20still%20banging%20my%20head%20against%20the%20wall.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20attached%20a%20file.%20%26nbsp%3BIn%20Column%20G%20(second%20column)%2C%20there%20is%20original%20text.%20%26nbsp%3BI%20removed%20unnecessary%20data%20and%20this%20is%20presented%20in%20the%20first%20column.%20%26nbsp%3BIt%20should%20be%20a%20simple%20process%20to%20convert%20the%20text%20to%20a%20date%20using%20%3D%2Bdatevalue(B1)%20which%20I%20tried%20and%20the%20result%20is%20in%20the%20the%20third%20column.%20As%20you%20can%20see%2C%20it%20returned%20a%20%23VALUE!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20suggestions%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKind%20regards%2C%3C%2FP%3E%3CP%3EFrank%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-69652%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-69652%22%20slang%3D%22en-US%22%3E%3CP%3EUnfortunately%20there%20is%20no%20way%20to%20change%20it.%20It%20is%20an%20export%20from%20specific%20software%26nbsp%3Bwhich%20does%20not%26nbsp%3Ballow%20you%20to%20specify%20exporting%20options.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20help%20though!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-69646%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-69646%22%20slang%3D%22en-US%22%3E%3CP%3EMy%20guess%20was%20you%20have%20two-digits%20year%20format%20for%20the%20date%2C%20like%2017-03-27.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20on%20your%20screenshot%20you%20already%20have%20wrong%20dates%20in%20source%20csv%20file%20like%202027-03-17.%20In%20such%20case%20import%20wizard%20could%20do%20nothing%2C%20there%20is%20no%20conversion%20from%20two%20digit%20to%204%20digits%20year%20format.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20question%20is%20how%20dates%20as%202027-03-17%20appear%20in%20your%20source%20file.%20If%20no%20way%20to%20change%20that%2C%20when%20yes%2C%20easiest%20way%20to%20do%20conversions%20within%20Excel.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-69645%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-69645%22%20slang%3D%22en-US%22%3EThanks%20Sergei%20-%20the%20formula%20worked%20perfectly%20-%20in%20this%20case%20it%20might%20be%20the%20best%20solution%20for%20me.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-69639%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-69639%22%20slang%3D%22en-US%22%3E%3CP%3EI've%20tried%20the%20import%20and%20it%20doesn't%20seem%20to%20work....%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F14527i2F2166BE871CED1C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22%5Ba0ec3810be815347ab3ed0dfa99c1edc%5D_Image%25202017-05-12%2520at%25204.59.23%2520PM.png%22%20title%3D%22%5Ba0ec3810be815347ab3ed0dfa99c1edc%5D_Image%25202017-05-12%2520at%25204.59.23%2520PM.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-69632%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-69632%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Reuben%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20formula%20could%20be%20as%3C%2FP%3E%3CPRE%3E%3DDATE(DAY(A1)%2B2000%2CMONTH(A1)%2CMOD(YEAR(A1)%2C2000))%3C%2FPRE%3E%3CP%3Eassuming%20all%20your%20dates%20are%20in%2021st%20century.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20in%20A1%20is%202027-03-17%20(as%20date%2C%20not%20text)%20the%20formula%20returns%202017-03-27.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20i'd%20start%20from%20second%20option%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-69616%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-69616%22%20slang%3D%22en-US%22%3EThanks%20Sergei!%20I'll%20definitely%20try%20that.%20I%20couldn't%20find%20a%20formula%20for%20your%20option%20%231%20but%20I'll%20try%20option%20%232%20and%20see%20how%20it%20works.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-69585%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-69585%22%20slang%3D%22en-US%22%3EGood%20call%20Sergei%2C%20I%20didn't%20catch%20that%20difference%2C%20thanks%20for%20clarifying%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-69554%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-69554%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Reuben%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20your%20regional%20settings%20are%20in%20ISO%20format%20(2017-03-17)%20and%20in%20your%20csv%20file%20dates%20looks%20like%2027-03-17%20when%20yes%2C%20such%20data%20will%20be%20recognized%26nbsp%3Bas%20one%20in%20year%202027.%20Since%20Excel%20considers%20your%20csv%20date%20as%20one%20with%20two-digits%20year%20format%2C%20i.e.%20as%20YY-MM-DD.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAbove%20is%20my%20guess%20since%20not%20clear%20how%20dates%20are%20formatted%20within%20csv%20(text)%20file.%20If%20so%2C%20there%20are%20two%20ways%20to%20fix%3C%2FP%3E%3CP%3E1)%20use%20Excel%20formulas%20to%20change%20years%20and%20dates%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2)%20or%20simply%20not%20to%20open%20csv%20file%20but%20import%20data%20from%20it%20into%20new%20excel%20workbook%20(use%20Get%20Data%20from%20Text)%2C%20on%20the%20third%20step%20of%20the%20importing%20wizard%20for%20column%20data%20format%20select%20Date%20and%20change%20default%20YMD%20on%20DMY.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-69541%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-69541%22%20slang%3D%22en-US%22%3EHighlight%20the%20cells%20that%20need%20formatting%20changed%2C%20go%20to%20the%20top%20banner%20under%20the%20%22numbers%22%20section%2C%20and%20click%20on%20the%20icon%20in%20the%20bottom%20right%20corner.%20Clicking%20on%20this%20bottom%20right%20corner%20will%20pop%20out%20another%20box%20with%20more%20options.%20Click%20on%20%22date%22%20on%20the%20left%20side%20of%20the%20pop-out%20and%20select%20the%20date%20format%20that%20fits%20your%20needs.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-490863%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20convert%20date%20format%20from%20imported%20data%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-490863%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F159249%22%20target%3D%22_blank%22%3E%40Michelle%20Gross%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Michelle%2C%3C%2FP%3E%3CP%3EI'm%20interested%20to%20know%20if%20you%20managed%20to%20solve%20your%20problem%20(I%20sure%20hope%20so%20by%20now)%20and%20I%20am%20curious%20as%20to%20how%20you%20would%20resolve%20your%20date%20format%20with%20the%20potential%20of%20only%201%20digit%20for%20both%20day%20and%20month.%26nbsp%3B%20In%20your%20example%2C%20you%20state%20that%20152017%20is%20interpreted%20as%2001-May.%26nbsp%3B%20By%20extension%2C%20I%20guess%201052017%20would%20be%20read%20as%2010-May.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20how%20would%20you%20interpret%201112017%3F%26nbsp%3B%20Is%20that%201-Nov%20or%2011-Jan%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere's%20some%20irony%20too%2C%20given%20that%20you%20have%20a%204-digit%20year%2C%20but%20only%20a%201-digit%20day%20and%20month.%3C%2FP%3E%3CP%3EI%20am%20having%20challenges%20importing%20data%20in%20a%20similar%20format%2C%20but%20it%20appears%20I%20always%20have%20a%202-digit%20month%2C%20eg%2C%201052017%20is%20always%201-May%20and%20not%2010-May.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Reuben Helder
Contributor

I have a csv file exported from another program with a column of dates. Excel recognizes the data as dates but it converts them to the wrong format.

 

The problem is the date March 27, 2017 shows up as 2027-03-17.

 

Is there a way to convert those dates to 27-Mar-2017 or something correct?

 

I've tried using "text to columns" but it didn't work. Maybe I'm doing something wrong......

14 Replies
Highlight the cells that need formatting changed, go to the top banner under the "numbers" section, and click on the icon in the bottom right corner. Clicking on this bottom right corner will pop out another box with more options. Click on "date" on the left side of the pop-out and select the date format that fits your needs.

Hi Reuben,

 

If your regional settings are in ISO format (2017-03-17) and in your csv file dates looks like 27-03-17 when yes, such data will be recognized as one in year 2027. Since Excel considers your csv date as one with two-digits year format, i.e. as YY-MM-DD.

 

Above is my guess since not clear how dates are formatted within csv (text) file. If so, there are two ways to fix

1) use Excel formulas to change years and dates

 

2) or simply not to open csv file but import data from it into new excel workbook (use Get Data from Text), on the third step of the importing wizard for column data format select Date and change default YMD on DMY.

 

 

Good call Sergei, I didn't catch that difference, thanks for clarifying
Thanks Sergei! I'll definitely try that. I couldn't find a formula for your option #1 but I'll try option #2 and see how it works.
Solution

Hi Reuben,

 

The formula could be as

=DATE(DAY(A1)+2000,MONTH(A1),MOD(YEAR(A1),2000))

assuming all your dates are in 21st century.

 

If in A1 is 2027-03-17 (as date, not text) the formula returns 2017-03-27.

 

However, i'd start from second option

I've tried the import and it doesn't seem to work....[a0ec3810be815347ab3ed0dfa99c1edc]_Image%202017-05-12%20at%204.59.23%20PM.png

Thanks Sergei - the formula worked perfectly - in this case it might be the best solution for me.

My guess was you have two-digits year format for the date, like 17-03-27.

 

As on your screenshot you already have wrong dates in source csv file like 2027-03-17. In such case import wizard could do nothing, there is no conversion from two digit to 4 digits year format.

 

The question is how dates as 2027-03-17 appear in your source file. If no way to change that, when yes, easiest way to do conversions within Excel.

Unfortunately there is no way to change it. It is an export from specific software which does not allow you to specify exporting options.

 

Thanks for your help though!

I am late to this dance but I have a similar problem to that which has been discussed here. While mine seems to be easier, I am still banging my head against the wall.

 

I have attached a file.  In Column G (second column), there is original text.  I removed unnecessary data and this is presented in the first column.  It should be a simple process to convert the text to a date using =+datevalue(B1) which I tried and the result is in the the third column. As you can see, it returned a #VALUE!

 

Any suggestions?

 

Kind regards,

Frank

I am late to this dance but I have a similar problem to that which has been discussed here. While mine seems to be easier, I am still banging my head against the wall.

 

I have attached a file.  In Column G (second column), there is original text.  I removed unnecessary data and this is presented in the first column.  It should be a simple process to convert the text to a date using =+datevalue(B1) which I tried and the result is in the the third column. As you can see, it returned a #VALUE!

 

Any suggestions?

 

Kind regards,

Frank

That feels much better- I stopped hitting my head against the wall.  I discovered the problem: the system settings were not in synch with the date format in Excel.  Once I changed the system format, everything was okay!

 

Have a good day.

 

Frank

Excel will not format my date that's being pulled from my program (this is a csv file).  I have never had an issue with this until a couple days ago.  Date will read 512017 which needs to be formatted to 05012018 (mmddyyyy or mm/dd/yyyy) I've come close to getting the proper format however, Excel changes my data to completely different numbers.  How do I fix this issue?

 

Thanks, Michelle

@Michelle Gross 

Hi Michelle,

I'm interested to know if you managed to solve your problem (I sure hope so by now) and I am curious as to how you would resolve your date format with the potential of only 1 digit for both day and month.  In your example, you state that 152017 is interpreted as 01-May.  By extension, I guess 1052017 would be read as 10-May.

 

But how would you interpret 1112017?  Is that 1-Nov or 11-Jan?

 

There's some irony too, given that you have a 4-digit year, but only a 1-digit day and month.

I am having challenges importing data in a similar format, but it appears I always have a 2-digit month, eg, 1052017 is always 1-May and not 10-May.