Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
DJ
 
Posts: n/a
Default converting 8-digit number to date

I have been given an Excel spreadsheet with numbers in 8-digit text format.
For example, 20020812 would be August 12, 2002. How do I convert these to
some sort of date field that will allow me to perform calculations (count
days from one date to the next)?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default converting 8-digit number to date

If they're in one column...

Select the range
data|text to columns
choose fixed width and remove any lines that excel guessed
choose Date (ymd)
and plop it in the same range as where you picked it up.

And format those (now real) dates the way you want.

DJ wrote:

I have been given an Excel spreadsheet with numbers in 8-digit text format.
For example, 20020812 would be August 12, 2002. How do I convert these to
some sort of date field that will allow me to perform calculations (count
days from one date to the next)?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default converting 8-digit number to date

a formula
=DATEVALUE(LEFT(F6,4)&"/"&MID(F6,5,2)&"/"&RIGHT(F6,2))
do you need a macro?
--
Don Guillett
SalesAid Software

"DJ" wrote in message
...
I have been given an Excel spreadsheet with numbers in 8-digit text format.
For example, 20020812 would be August 12, 2002. How do I convert these to
some sort of date field that will allow me to perform calculations (count
days from one date to the next)?



  #4   Report Post  
Posted to microsoft.public.excel.misc
Biff
 
Posts: n/a
Default converting 8-digit number to date

Hi!

Try this:

Select the range in question.
Goto DataText to Columns
Click Next, Next
Select Date
From the drop down select YMD
Click Finish

Biff

"DJ" wrote in message
...
I have been given an Excel spreadsheet with numbers in 8-digit text format.
For example, 20020812 would be August 12, 2002. How do I convert these to
some sort of date field that will allow me to perform calculations (count
days from one date to the next)?



  #5   Report Post  
Posted to microsoft.public.excel.misc
Paul Mathews
 
Posts: n/a
Default converting 8-digit number to date

Assuming that your number is in cell A1, this formula will return a date:

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

"DJ" wrote:

I have been given an Excel spreadsheet with numbers in 8-digit text format.
For example, 20020812 would be August 12, 2002. How do I convert these to
some sort of date field that will allow me to perform calculations (count
days from one date to the next)?



  #6   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph
 
Posts: n/a
Default converting 8-digit number to date

"DJ" wrote in message
...
I have been given an Excel spreadsheet with numbers in 8-digit text format.
For example, 20020812 would be August 12, 2002. How do I convert these to
some sort of date field that will allow me to perform calculations (count
days from one date to the next)?


Data/ Text to Columns/ Fixed Width
Select output as Date/ YMD
--
David Biddulph


  #7   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default converting 8-digit number to date


Text to columns would appear to be the best approach, although if you
did want a formula here's a simple one

=TEXT(A1,"0000-00-00")+0


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=551220

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
Date to TEXT. NOT to sequential serial number Gene Excel Discussion (Misc queries) 2 May 26th 06 09:33 PM
How can i paste a 16 digit number in a excel worksheet? Rajeshkumar Excel Discussion (Misc queries) 2 January 21st 06 11:19 AM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM
unwanted number to date conversion while pasting data from web Jacek Excel Worksheet Functions 1 February 24th 05 02:59 PM
Use Julian Date To Create Serial Number antho10359 Excel Discussion (Misc queries) 4 December 9th 04 01:50 AM


All times are GMT +1. The time now is 09:48 AM.

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

About Us

"It's about Microsoft Excel"