Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-05-2017, 12:27 PM
SVanderkolff SVanderkolff is offline need help reformatting a date from old dos file Windows 10 need help reformatting a date from old dos file Office 2013
Novice
need help reformatting a date from old dos file
 
Join Date: Jan 2017
Location: Mildmay, Ontario, Canada
Posts: 3
SVanderkolff is on a distinguished road
Default need help reformatting a date from old dos file

I have a CSV file that I have imported into excel that originated in an older DOS based program. The date comes across in a format of 101202 being December 2 2010. I need to get it into a format that Excel recognizes as a date.


Any help greatly appreciated.
Thanks
Steve
Reply With Quote
  #2  
Old 01-05-2017, 10:17 PM
xor xor is offline need help reformatting a date from old dos file Windows 10 need help reformatting a date from old dos file Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,100
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

Maybe like this.
Attached Files
File Type: xlsx Reformatting.xlsx (9.4 KB, 10 views)
Reply With Quote
  #3  
Old 01-06-2017, 08:05 AM
SVanderkolff SVanderkolff is offline need help reformatting a date from old dos file Windows 10 need help reformatting a date from old dos file Office 2013
Novice
need help reformatting a date from old dos file
 
Join Date: Jan 2017
Location: Mildmay, Ontario, Canada
Posts: 3
SVanderkolff is on a distinguished road
Default

The solution you gave me, thank you very much, gives me February 12th 2010 instead of December 2 2010. I will try and figure out how to fix it as well.
Thanks
Steve
Reply With Quote
  #4  
Old 01-06-2017, 08:26 AM
SVanderkolff SVanderkolff is offline need help reformatting a date from old dos file Windows 10 need help reformatting a date from old dos file Office 2013
Novice
need help reformatting a date from old dos file
 
Join Date: Jan 2017
Location: Mildmay, Ontario, Canada
Posts: 3
SVanderkolff is on a distinguished road
Default

Got it figured out. It now works, Thanks.
Can you explain what the forumula does. What are the command portions.
Thanks
Steve
Reply With Quote
  #5  
Old 01-06-2017, 09:10 AM
xor xor is offline need help reformatting a date from old dos file Windows 10 need help reformatting a date from old dos file Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,100
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

The problem you experienced may be due to the fact that I use Danish settings.

The formula: =--(RIGHT(A1,2)&"-"&MID(A1,3,2)&"-"&LEFT(A1,2)) where A1 = 101202 does the following:

RIGHT(A1,2) takes the two rightmost digits of 101202 that is 02 and concatenates this with a hyphen (which is what I use as separator between day month and year). This is then concatenated with the result of MID(A1,3,2) which takes two digits from 101202 starting at position 3. This again is concatenated with first a hyphen and then with the result of LEFT(A1,2) which takes the two leftmost digits of 101202, that is 10. The result being: 02-12-10 which is a text string. To convert this text string to a date I put double minus immediately after the equal sign. First minus sign convert the text string to a (negative) number and the second minus sign convert the negative number to a positive (date)= 02-12-2010 which on my system means 2nd December 2010.

You can check that conversion by highlighting (in the Formula field) exactly the following part of the formula:

-(RIGHT(A1,2)&"-"&MID(A1,3,2)&"-"&LEFT(A1,2)) that is with only one of the minus signs and press F9. You will see -40514 where 40514 is the serial number for the date 2nd December 2010. If you next try to highlight the whole formula including both minus signs and press F9 you will see the result 40514.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent XL from reformatting when data copy/pasted BRDas Excel 8 05-10-2016 01:24 PM
need help reformatting a date from old dos file How can a document have the same date modified/create date, yes have have actual file content? legaleagle Word 15 01-07-2015 06:58 PM
Reformatting the spacing for numbers Metro57 Word 1 04-07-2014 08:00 PM
Creating booklet without reformatting Acesfull145 Word 0 08-21-2013 07:42 AM
need help reformatting a date from old dos file Heading styles constantly reformatting lizziecassmaran Word 8 12-11-2011 01:32 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:08 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft