Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #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,101
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
 



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 07:13 AM.


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