Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Kim Kim is offline
external usenet poster
 
Posts: 284
Default How do you format a number into a date?

I have a colunm of numbers some are eight digits long, 12221967, and some are
seven digits long, 8031985. How would i format them into a date like
12/22/1967 or 8/03/1985??
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default How do you format a number into a date?

one wy ...

=IF(LEN(A1)=8,DATE(RIGHT(A1,4),MID(A1,3,2),LEFT(A1 ,2)),DATE(RIGHT(A1,4),MID(A1,2,2),LEFT(A1,1)))

format cell as DATE

"kim" wrote:

I have a colunm of numbers some are eight digits long, 12221967, and some are
seven digits long, 8031985. How would i format them into a date like
12/22/1967 or 8/03/1985??

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default How do you format a number into a date?

.... I assumed UK date format (DDMMYYYY) so for US format:

=IF(LEN(A1)=8,DATE(RIGHT(A1,4),LEFT(A1,2),MID(A1,3 ,2)),DATE(RIGHT(A1,4),LEFT(A1,1),MID(A1,2,2)))

"Toppers" wrote:

one wy ...

=IF(LEN(A1)=8,DATE(RIGHT(A1,4),MID(A1,3,2),LEFT(A1 ,2)),DATE(RIGHT(A1,4),MID(A1,2,2),LEFT(A1,1)))

format cell as DATE

"kim" wrote:

I have a colunm of numbers some are eight digits long, 12221967, and some are
seven digits long, 8031985. How would i format them into a date like
12/22/1967 or 8/03/1985??

  #4   Report Post  
Posted to microsoft.public.excel.misc
Kim Kim is offline
external usenet poster
 
Posts: 284
Default How do you format a number into a date?

hmm, i tried this and i get a Value error in the cell. I must be doing
something wrong.

"Toppers" wrote:

... I assumed UK date format (DDMMYYYY) so for US format:

=IF(LEN(A1)=8,DATE(RIGHT(A1,4),LEFT(A1,2),MID(A1,3 ,2)),DATE(RIGHT(A1,4),LEFT(A1,1),MID(A1,2,2)))

"Toppers" wrote:

one wy ...

=IF(LEN(A1)=8,DATE(RIGHT(A1,4),MID(A1,3,2),LEFT(A1 ,2)),DATE(RIGHT(A1,4),MID(A1,2,2),LEFT(A1,1)))

format cell as DATE

"kim" wrote:

I have a colunm of numbers some are eight digits long, 12221967, and some are
seven digits long, 8031985. How would i format them into a date like
12/22/1967 or 8/03/1985??

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default How do you format a number into a date?

Check that your numbers are numbers and not text with leading or
trailing spaces - if you do have these then you can get rid of them
using TRIM(A1) wherever A1 appears in Toppers' formula.

Hope this helps.

Pete

kim wrote:
hmm, i tried this and i get a Value error in the cell. I must be doing
something wrong.

"Toppers" wrote:

... I assumed UK date format (DDMMYYYY) so for US format:

=IF(LEN(A1)=8,DATE(RIGHT(A1,4),LEFT(A1,2),MID(A1,3 ,2)),DATE(RIGHT(A1,4),LEFT(A1,1),MID(A1,2,2)))

"Toppers" wrote:

one wy ...

=IF(LEN(A1)=8,DATE(RIGHT(A1,4),MID(A1,3,2),LEFT(A1 ,2)),DATE(RIGHT(A1,4),MID(A1,2,2),LEFT(A1,1)))

format cell as DATE

"kim" wrote:

I have a colunm of numbers some are eight digits long, 12221967, and some are
seven digits long, 8031985. How would i format them into a date like
12/22/1967 or 8/03/1985??




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do you format a number into a date?

Another way:
Insert a helper column and fill it with formulas like:

=--TEXT(A1,"00\/00\/0000")

Format that column as a date.

Then select that helper column
edit|copy
edit|paste special|values
and delete the original column of data???




kim wrote:

I have a colunm of numbers some are eight digits long, 12221967, and some are
seven digits long, 8031985. How would i format them into a date like
12/22/1967 or 8/03/1985??


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.misc
Kim Kim is offline
external usenet poster
 
Posts: 284
Default How do you format a number into a date?

Thanks for you info. I still can't get it to work, but thanks for trying!! :)

"kim" wrote:

I have a colunm of numbers some are eight digits long, 12221967, and some are
seven digits long, 8031985. How would i format them into a date like
12/22/1967 or 8/03/1985??

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
Mileage Claim Formula johndavies New Users to Excel 4 August 14th 06 09:24 AM
Date column changed to number format while concatenating Biju Jacob Excel Discussion (Misc queries) 1 June 12th 06 07:07 PM
" / " Changing Decimal number format to Fraction on Protected Cell laudie Excel Worksheet Functions 0 November 15th 05 02:13 AM
Help needed with date format [email protected] Excel Discussion (Misc queries) 1 August 29th 05 09:11 AM
Date Format Squirrelly Bill Martin -- (Remove NOSPAM from address) Excel Discussion (Misc queries) 3 August 18th 05 09:43 PM


All times are GMT +1. The time now is 12:37 PM.

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"