reversing numbers to create dates

  • Thread starter Thread starter Gilles Desjardins
  • Start date Start date
G

Gilles Desjardins

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
 
Gilles,

Try:

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

--
HTH

Sandy
(e-mail address removed)
Replace@mailinator with @tiscali.co.uk
 
Try this:

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

This assumes your 'date' number is in A1
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top