Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default how to convert a column of numbers (monthdayyear) into dates?

At issue is some numbers are 7 digits and some 8 (ie 7012006 or 10012006).
None of my attempts resulted in excel recognizing as valid dates.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default how to convert a column of numbers (monthdayyear) into dates?

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

Vaya con Dios,
Chuck, CABGx3



"wsucougar" wrote:

At issue is some numbers are 7 digits and some 8 (ie 7012006 or 10012006).
None of my attempts resulted in excel recognizing as valid dates.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,047
Default how to convert a column of numbers (monthdayyear) into dates?

Hi,

try it

=if(len(b2)=7,date(right(b2,4),left(b2,1),mid(b2,2 ,2)),date(right(b2,4),left(b2,2),mid(b2,3,2)))

hth
regards from Brazil
Marcelo

"wsucougar" escreveu:

At issue is some numbers are 7 digits and some 8 (ie 7012006 or 10012006).
None of my attempts resulted in excel recognizing as valid dates.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default how to convert a column of numbers (monthdayyear) into dates?

On Tue, 15 Aug 2006 10:37:02 -0700, wsucougar
wrote:

At issue is some numbers are 7 digits and some 8 (ie 7012006 or 10012006).
None of my attempts resulted in excel recognizing as valid dates.


Here's one method:

=DATE(MOD(A1,10^4),INT(A1/10^6),MOD(INT(A1/10^4),100))


--ron
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default how to convert a column of numbers (monthdayyear) into dates?

Sorry, forgot the final case of the cell being anything other than containing
7 or 8 characters...........

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

Vaya con Dios,
Chuck, CABGx3



"CLR" wrote:

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

Vaya con Dios,
Chuck, CABGx3



"wsucougar" wrote:

At issue is some numbers are 7 digits and some 8 (ie 7012006 or 10012006).
None of my attempts resulted in excel recognizing as valid dates.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default how to convert a column of numbers (monthdayyear) into dates?

Thanks for your help it was just what I needed and it works great!

"CLR" wrote:

Sorry, forgot the final case of the cell being anything other than containing
7 or 8 characters...........

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

Vaya con Dios,
Chuck, CABGx3



"CLR" wrote:

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

Vaya con Dios,
Chuck, CABGx3



"wsucougar" wrote:

At issue is some numbers are 7 digits and some 8 (ie 7012006 or 10012006).
None of my attempts resulted in excel recognizing as valid dates.

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
Sum/average numbers in column A dependant on value in column B Sue Excel Worksheet Functions 3 March 29th 06 06:39 PM
Conditional Format as a MACRO Gunjani Excel Worksheet Functions 3 March 29th 06 05:22 PM
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
Consecutive Numbers down a column not to Exceed 49 Nelson Excel Worksheet Functions 6 July 18th 05 09:32 PM
How do you convert numbers as "text" to values for a long column . geoexcel Excel Discussion (Misc queries) 2 February 27th 05 04:31 PM


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