Convert year from YY to YYYY with year in 1900's

joy1mat

New Member
Joined
Jun 26, 2016
Messages
31
Office Version
  1. 365
Platform
  1. Windows
Hi, I'm working on a spreadsheet with 15K entries. All have the year as dd-mm-yy. The column is formatted as text. Some of the years are 1800's which I'm not worried about as these are all in YYYY. All the other dates are from the 1900's. I tried using the formula =TEXT(DATE(1900+MOD(YEAR(G2),1000),MONTH(G2),DAY(G2)),"dd-mmm-yyyy"). This works fine up to about the 1950's when the year goes to the 2800's. Can someone help with a formula that will keep all the years in the 1900's.

Joyce
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
This works fine up to about the 1950's when the year goes to the 2800's.
It's not completely clear what you've got here. With 1900+MOD(YEAR(G2),1000), I'd have expected all 1900's dates to be converted to 2800's?

Will =TEXT(G2,"dd-mm-yyyy") suffice?
 
Upvote 0
Hi Stephen

No =TEXT(G2,"dd-mm-yyyy") puts all the years into 2000 range and I need 1900's. I'm not sure why all the 1900's dates didn't convert to 2800's but those dates between 1900-1950 appear to work and those 1951 to 1999 go into the 2800 range.

I've attached a snip of a few lines of data where you can see the result of the formula with MOD included. The 1800 range isn't a problem as the #value error will be good when I have to sort the data into the date range. First I need to get the years into 1900's.

Any other thoughts on how I can do this?

Joyce
 

Attachments

  • Formula snip to change from yy to yyyy in 1900s.JPG
    Formula snip to change from yy to yyyy in 1900s.JPG
    56.6 KB · Views: 59
Upvote 0
Hello Mick and Stephen

The Substitute formula from Mick works. The 1800 years just has an extra 19 in front but with your updated formula with IF statement leaves these dates as they are. So this is a great solution. Many thanks to you both.

Joyce
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,179
Members
448,871
Latest member
hengshankouniuniu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top