Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Converting to Date Format

I inherited a spreadsheet in which the dates were input as 18.02.06. How can
I best convert this string into a proper date format.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Converting to Date Format

If they are always in that format, with two digits for day, month and
year, then you can use this, assuming the value is in A1:

=DATE("20"&RIGHT(A1,2),MID(A1,4,2),LEFT(A1,2))

Format the cell as a date. This assumes all years will be in this
century - if you have some dates with 99, 98, 97 etc this will need a
bit of modification. Copy the formula down as required.

Hope this helps.

Pete

On Nov 21, 12:50 am, KFred wrote:
I inherited a spreadsheet in which the dates were input as 18.02.06. How can
I best convert this string into a proper date format.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Converting to Date Format

Here's the modification I mentioned:

=DATE(IF(RIGHT(A1,2)*1<30,"20","19")&RIGHT(A1,2),M ID(A1,4,2),LEFT(A1,2))

This assumes that years from 00 to 29 are in this century, and years
from 30 to 99 are in last century - change the 30 in the formula if
you want to make it a different break point.

Hope this helps.

Pete

On Nov 21, 12:50 am, KFred wrote:
I inherited a spreadsheet in which the dates were input as 18.02.06. How can
I best convert this string into a proper date format.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Converting to Date Format

Thanks Pete,

Just curious what the "20"& signifies in the formula.

Fred

"Pete_UK" wrote:

If they are always in that format, with two digits for day, month and
year, then you can use this, assuming the value is in A1:

=DATE("20"&RIGHT(A1,2),MID(A1,4,2),LEFT(A1,2))

Format the cell as a date. This assumes all years will be in this
century - if you have some dates with 99, 98, 97 etc this will need a
bit of modification. Copy the formula down as required.

Hope this helps.

Pete

On Nov 21, 12:50 am, KFred wrote:
I inherited a spreadsheet in which the dates were input as 18.02.06. How can
I best convert this string into a proper date format.



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Converting to Date Format

=Right(A1,2)
will return "18"
So
"20"&"18"
will be
"2018"

Eleven years from now (about).

KFred wrote:

Thanks Pete,

Just curious what the "20"& signifies in the formula.

Fred

"Pete_UK" wrote:

If they are always in that format, with two digits for day, month and
year, then you can use this, assuming the value is in A1:

=DATE("20"&RIGHT(A1,2),MID(A1,4,2),LEFT(A1,2))

Format the cell as a date. This assumes all years will be in this
century - if you have some dates with 99, 98, 97 etc this will need a
bit of modification. Copy the formula down as required.

Hope this helps.

Pete

On Nov 21, 12:50 am, KFred wrote:
I inherited a spreadsheet in which the dates were input as 18.02.06. How can
I best convert this string into a proper date format.




--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Converting to Date Format

=Right(A1,2), for the OP's example, would return 06, not 18, but the
principle was right, Dave!
--
David Biddulph

"Dave Peterson" wrote in message
...
=Right(A1,2)
will return "18"
So
"20"&"18"
will be
"2018"

Eleven years from now (about).

KFred wrote:

Thanks Pete,

Just curious what the "20"& signifies in the formula.

Fred

"Pete_UK" wrote:

If they are always in that format, with two digits for day, month and
year, then you can use this, assuming the value is in A1:

=DATE("20"&RIGHT(A1,2),MID(A1,4,2),LEFT(A1,2))

Format the cell as a date. This assumes all years will be in this
century - if you have some dates with 99, 98, 97 etc this will need a
bit of modification. Copy the formula down as required.

Hope this helps.

Pete

On Nov 21, 12:50 am, KFred wrote:
I inherited a spreadsheet in which the dates were input as 18.02.06.
How can
I best convert this string into a proper date format.



--

Dave Peterson



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Converting to Date Format

Right, left. I still get them mixed up!

Thanks for the correction, David.

David Biddulph wrote:

=Right(A1,2), for the OP's example, would return 06, not 18, but the
principle was right, Dave!
--
David Biddulph

"Dave Peterson" wrote in message
...
=Right(A1,2)
will return "18"
So
"20"&"18"
will be
"2018"

Eleven years from now (about).

KFred wrote:

Thanks Pete,

Just curious what the "20"& signifies in the formula.

Fred

"Pete_UK" wrote:

If they are always in that format, with two digits for day, month and
year, then you can use this, assuming the value is in A1:

=DATE("20"&RIGHT(A1,2),MID(A1,4,2),LEFT(A1,2))

Format the cell as a date. This assumes all years will be in this
century - if you have some dates with 99, 98, 97 etc this will need a
bit of modification. Copy the formula down as required.

Hope this helps.

Pete

On Nov 21, 12:50 am, KFred wrote:
I inherited a spreadsheet in which the dates were input as 18.02.06.
How can
I best convert this string into a proper date format.



--

Dave Peterson


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting Numbers to Date Format MB Excel Worksheet Functions 2 February 6th 07 10:49 PM
Converting US Date Format Neil Mitchell-Goodson Excel Worksheet Functions 0 November 21st 06 12:20 PM
Converting date format Brian Excel Discussion (Misc queries) 2 May 2nd 06 02:31 AM
Converting to date format ahaigh Excel Discussion (Misc queries) 1 March 13th 06 06:54 PM
Converting number or text to a Date Format samhain New Users to Excel 2 October 17th 05 02:28 PM


All times are GMT +1. The time now is 12:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"