Forum Discussion
Date format showing different after downloading
Let's say your dates are in A2 and down.
In another cell in row 2, enter the formula
=EDATE(A2,1200*(YEAR(A2)<2000))
and fill down.
You can either use the new dates, or copy them, then paste them as Values over the original dates.
Thank you.
- HansVogelaarDec 10, 2022MVP
Apparently the download specifies the year using only 2 digits. Excel (or rather Windows) then has to decide whether 40 means 1940 or 2040. There is a cutoff for this in Regional Settings. On many systems, 30 is the cutoff: 00 to 29 are interpreted as 2000 to 2029, and 30 to 99 are interpreted as 1930 to 1999.
So Excel will convert 1-Jan-30 to 01/01/1930.
The formula that I posted checks whether the year of the converted date is before 2000, and if so, adds 100 years = 1200 months using the EDATE function.
In VBA, you could use DateAdd("yyyy", 100, SomeDate) to add 100 years.
- indresh268Dec 11, 2022Copper ContributorDear hans,
Thank you for the reply, tried this solution and its working for the date column.
but customer wanted the date as customized and our solution stores the same in text column.
but when I apply your suggestion over there, these columns are as text type instead of date.
Now I need to read and every columns as value and check for the format 'DD-MON-YY' and if values matches needs to convert that as date and apply.
will update you with the progress. meanwhile if you have any suggestion regarding this via javascript please let me know.
Thank you.
Regards,
Indra- peiyezhuDec 12, 2022Bronze Contributorregarding this via javascript
what you mean via JavaScript?
or vba?