Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Gilles Desjardins
 
Posts: n/a
Default reversing numbers to create dates

Hi everyone,

I receive data from an old database program like this:
19910224. I need to convert to a date format in order to use the datedif()
function.
The final product should be 24-Feb-1991 OR 1991-02-24 in date format.
Formatting like the latter example does not help. My "numbers" do not
convert to dates. All I achieve is 1991-02-24 and I can't use datedif.
Can anyone help.

TIA

Gilles Desjardins


  #3   Report Post  
Vasant Nanavati
 
Posts: n/a
Default

=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))

--

Vasant



"Gilles Desjardins" wrote in message
.. .
Hi everyone,

I receive data from an old database program like this:
19910224. I need to convert to a date format in order to use the datedif()
function.
The final product should be 24-Feb-1991 OR 1991-02-24 in date format.
Formatting like the latter example does not help. My "numbers" do not
convert to dates. All I achieve is 1991-02-24 and I can't use datedif.
Can anyone help.

TIA

Gilles Desjardins



  #4   Report Post  
Cutter
 
Posts: n/a
Default


Try this:

=DATE(LEFT(A1,4),MID(A1,5,2),RIGHT(A1,2))

This assumes your 'date' number is in A1


--
Cutter
------------------------------------------------------------------------
Cutter's Profile: http://www.excelforum.com/member.php...fo&userid=9848
View this thread: http://www.excelforum.com/showthread...hreadid=473167

  #5   Report Post  
Dave Peterson
 
Posts: n/a
Default

If all those "dates" are in a single column, you could even use Data|text to
columns.

Use YMD as the field format.

Then format that column the way you want.

Gilles Desjardins wrote:

Hi everyone,

I receive data from an old database program like this:
19910224. I need to convert to a date format in order to use the datedif()
function.
The final product should be 24-Feb-1991 OR 1991-02-24 in date format.
Formatting like the latter example does not help. My "numbers" do not
convert to dates. All I achieve is 1991-02-24 and I can't use datedif.
Can anyone help.

TIA

Gilles Desjardins


--

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
numbers contain hyphens to dates bill gras Excel Worksheet Functions 1 August 11th 05 04:39 AM
dates change to numbers Debbie Excel Worksheet Functions 1 March 29th 05 10:31 PM
Stop numbers converting to dates. biglar85012 Excel Worksheet Functions 2 March 29th 05 06:09 PM
Dates to numbers John Excel Worksheet Functions 0 February 8th 05 11:45 AM
how to create dates before 1900 Pieter Excel Worksheet Functions 2 February 3rd 05 09:06 PM


All times are GMT +1. The time now is 07:50 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"