Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
slf slf is offline
external usenet poster
 
Posts: 8
Default CHANGE TEXT DATE TO NUMERIC DATE

The following imported data isn't recognized as a dates:

Jul 4 2008 6:30AM
Jun 22 2007 5:59PM

I have tried both of these formulas found elsewhere in the Excel Community
without luck:

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

=TEXT(TEXT(A1,"00000000"),"00-00-0000")+0
........................
I need the month and year only, text to columns work but requires the data
to be copied elsewhere first.
using "=left" function can provide the month, but the placement of the year
varies by 1 character in the middle of the cell, so "=mid" can't be utilized.

I have used "=trim" function and tried the "=Datevalue" function also.

Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default CHANGE TEXT DATE TO NUMERIC DATE

It appears that you have the web symbol CHAR(160) in your text. To extract
just the month and year, you can do this:

=LEFT(A2,3)&" "&MID(A2,FIND(CHAR(160),A2,5)-4,4)

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"slf" wrote:

The following imported data isn't recognized as a dates:

Jul 4 2008 6:30AM
Jun 22 2007 5:59PM

I have tried both of these formulas found elsewhere in the Excel Community
without luck:

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

=TEXT(TEXT(A1,"00000000"),"00-00-0000")+0
.......................
I need the month and year only, text to columns work but requires the data
to be copied elsewhere first.
using "=left" function can provide the month, but the placement of the year
varies by 1 character in the middle of the cell, so "=mid" can't be utilized.

I have used "=trim" function and tried the "=Datevalue" function also.

Any suggestions?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default CHANGE TEXT DATE TO NUMERIC DATE

Try this:
Sub Remove_CR_LF()
With Selection
..Replace What:=Chr(160), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
..Replace What:=Chr(13) & Chr(10), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
..Replace What:=Chr(10), Replacement:=Chr(32), _
LookAt:=xlPart, SearchOrder:=xlByRows, MatchCase:=False
End With
End Sub


--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"Luke M" wrote:

It appears that you have the web symbol CHAR(160) in your text. To extract
just the month and year, you can do this:

=LEFT(A2,3)&" "&MID(A2,FIND(CHAR(160),A2,5)-4,4)

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"slf" wrote:

The following imported data isn't recognized as a dates:

Jul 4 2008 6:30AM
Jun 22 2007 5:59PM

I have tried both of these formulas found elsewhere in the Excel Community
without luck:

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

=TEXT(TEXT(A1,"00000000"),"00-00-0000")+0
.......................
I need the month and year only, text to columns work but requires the data
to be copied elsewhere first.
using "=left" function can provide the month, but the placement of the year
varies by 1 character in the middle of the cell, so "=mid" can't be utilized.

I have used "=trim" function and tried the "=Datevalue" function also.

Any suggestions?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default CHANGE TEXT DATE TO NUMERIC DATE

On jan. 4, 21:41, slf wrote:
The following imported data isn't recognized as a dates:

Jul *4 2008 *6:30AM
Jun 22 2007 *5:59PM

I have tried both of these formulas found elsewhere in the Excel Community
without luck:

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

=TEXT(TEXT(A1,"00000000"),"00-00-0000")+0
.......................
I need the month and year only, text to columns work but requires the data
to be copied elsewhere first. *
using "=left" function can provide the month, but the placement of the year
varies by 1 character in the middle of the cell, so "=mid" can't be utilized.

I have used "=trim" function and tried the "=Datevalue" function also..

Any suggestions?


Try this:

=DATEVALUE(SUBSTITUTE(LEFT(TRIM(A1),SEARCH("/",SUBSTITUTE(TRIM(A1),"
","/",3)))," ","/"))

Not tested, because US Regional settings and English language Excel is
needed to properly evaluate this formula, I have a national language
version, but it should work.

Regards,
Stefi
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 25
Default CHANGE TEXT DATE TO NUMERIC DATE

On Jan 4, 10:11*pm, Stefi wrote:
On jan. 4, 21:41, slf wrote:





The following imported data isn't recognized as a dates:


Jul *4 2008 *6:30AM
Jun 22 2007 *5:59PM


I have tried both of these formulas found elsewhere in the Excel Community
without luck:


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


=TEXT(TEXT(A1,"00000000"),"00-00-0000")+0
.......................
I need the month and year only, text to columns work but requires the data
to be copied elsewhere first. *
using "=left" function can provide the month, but the placement of the year
varies by 1 character in the middle of the cell, so "=mid" can't be utilized.


I have used "=trim" function and tried the "=Datevalue" function also.


Any suggestions?


Try this:

=DATEVALUE(SUBSTITUTE(LEFT(TRIM(A1),SEARCH("/",SUBSTITUTE(TRIM(A1),"
","/",3)))," ","/"))

Not tested, because US Regional settings and English language Excel is
needed to properly evaluate this formula, I have a national language
version, but it should work.

Regards,
Stefi- Hide quoted text -

- Show quoted text -


This is tested:
=DATEVALUE(MID(A2,4,3)&"/"&LEFT(A2,3)&"/"&RIGHT(LEFT(TRIM($A$2),SEARCH
("/",SUBSTITUTE(TRIM($A$2)," ","/",3))-1),4))
It requires English Regional settings and English language Excel
version.

Regards,
Stefi


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 449
Default CHANGE TEXT DATE TO NUMERIC DATE

This little macro might work (or not, date math is very vulnerable to
regional settings). Select the cells in question and run this:


Sub test()
Dim Cel As Range
On Error Resume Next
For Each Cel In Intersect(Selection, ActiveSheet.UsedRange)
Cel.Value = DateValue(Cel.Value) + TimeValue(Cel.Value)
Next
End Sub

HTH. Best wishes Harald

"slf" wrote in message
...
The following imported data isn't recognized as a dates:

Jul 4 2008 6:30AM
Jun 22 2007 5:59PM

I have tried both of these formulas found elsewhere in the Excel Community
without luck:

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

=TEXT(TEXT(A1,"00000000"),"00-00-0000")+0
.......................
I need the month and year only, text to columns work but requires the data
to be copied elsewhere first.
using "=left" function can provide the month, but the placement of the
year
varies by 1 character in the middle of the cell, so "=mid" can't be
utilized.

I have used "=trim" function and tried the "=Datevalue" function also.

Any suggestions?


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 in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
Numeric date to text..formatting question JHB Excel Discussion (Misc queries) 2 October 4th 08 07:46 PM
Resetting cell format from TEXT to NUMERIC and DATE Tom Excel Discussion (Misc queries) 2 May 5th 08 05:43 AM
how do i change text format date to date (i.e., mm/yy to mm/dd/yyy lindsey Excel Discussion (Misc queries) 1 July 27th 07 10:05 PM
Date showing as numeric value in a text string formula dj479794 Excel Discussion (Misc queries) 4 July 2nd 07 11:59 PM


All times are GMT +1. The time now is 05:13 PM.

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"