Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
thekovinc
 
Posts: n/a
Default Dates formatted as text


Hello. I am currently having a problem with text/dates. I am importing
data from another file that is completely text formatted. Some of the
columns in this file contain dates in the form of "Jan-01-06," and it
is always "MMM-DD-YY."

I am trying to find the difference between two of these dates, but it
will not work because of the text formatting.

ie. A formula that would output the difference between Jan-16-06 and
Jan-12-06 (the answer would be 4 days).

I am wondering if there is any easy way to convert them to dates
(changing format does not work). I have thought about just using the
LEFT command to grab the middle two numbers for the date, but that does
not take into consideration month or year changes.

Please let me know if you can help. Thanks in advance!

Nick


--
thekovinc
------------------------------------------------------------------------
thekovinc's Profile: http://www.excelforum.com/member.php...o&userid=29378
View this thread: http://www.excelforum.com/showthread...hreadid=512340

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Dates formatted as text

Select one of the columns
data|text to columns
fixed width (but don't draw any lines)
tell excel that this field is a date (mdy)
and finish up.

(and do the remainder of the other columns, too.)

thekovinc wrote:

Hello. I am currently having a problem with text/dates. I am importing
data from another file that is completely text formatted. Some of the
columns in this file contain dates in the form of "Jan-01-06," and it
is always "MMM-DD-YY."

I am trying to find the difference between two of these dates, but it
will not work because of the text formatting.

ie. A formula that would output the difference between Jan-16-06 and
Jan-12-06 (the answer would be 4 days).

I am wondering if there is any easy way to convert them to dates
(changing format does not work). I have thought about just using the
LEFT command to grab the middle two numbers for the date, but that does
not take into consideration month or year changes.

Please let me know if you can help. Thanks in advance!

Nick

--
thekovinc
------------------------------------------------------------------------
thekovinc's Profile: http://www.excelforum.com/member.php...o&userid=29378
View this thread: http://www.excelforum.com/showthread...hreadid=512340


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Damon Longworth
 
Posts: n/a
Default Dates formatted as text

Have a look at the DateValue function.

--
Damon Longworth

2006 East Coast Excel User Conference
April 19/21st, 2006
Holiday Inn, Boardwalk
Atlantic City, New Jersey
Early Bird Registration Now Open!!
www.ExcelUserConference.com

2006 UK Excel User Conference
Summer, 2006
London, England


"thekovinc" wrote
in message ...

Hello. I am currently having a problem with text/dates. I am importing
data from another file that is completely text formatted. Some of the
columns in this file contain dates in the form of "Jan-01-06," and it
is always "MMM-DD-YY."

I am trying to find the difference between two of these dates, but it
will not work because of the text formatting.

ie. A formula that would output the difference between Jan-16-06 and
Jan-12-06 (the answer would be 4 days).

I am wondering if there is any easy way to convert them to dates
(changing format does not work). I have thought about just using the
LEFT command to grab the middle two numbers for the date, but that does
not take into consideration month or year changes.

Please let me know if you can help. Thanks in advance!

Nick


--
thekovinc
------------------------------------------------------------------------
thekovinc's Profile:
http://www.excelforum.com/member.php...o&userid=29378
View this thread: http://www.excelforum.com/showthread...hreadid=512340


  #4   Report Post  
Posted to microsoft.public.excel.misc
Damon Longworth
 
Posts: n/a
Default Dates formatted as text

Have a look at the DateValue function.

--
Damon Longworth

2006 East Coast Excel User Conference
April 19/21st, 2006
Holiday Inn, Boardwalk
Atlantic City, New Jersey
Early Bird Registration Now Open!!
www.ExcelUserConference.com

2006 UK Excel User Conference
Summer, 2006
London, England


"thekovinc" wrote
in message ...

Hello. I am currently having a problem with text/dates. I am importing
data from another file that is completely text formatted. Some of the
columns in this file contain dates in the form of "Jan-01-06," and it
is always "MMM-DD-YY."

I am trying to find the difference between two of these dates, but it
will not work because of the text formatting.

ie. A formula that would output the difference between Jan-16-06 and
Jan-12-06 (the answer would be 4 days).

I am wondering if there is any easy way to convert them to dates
(changing format does not work). I have thought about just using the
LEFT command to grab the middle two numbers for the date, but that does
not take into consideration month or year changes.

Please let me know if you can help. Thanks in advance!

Nick


--
thekovinc
------------------------------------------------------------------------
thekovinc's Profile:
http://www.excelforum.com/member.php...o&userid=29378
View this thread: http://www.excelforum.com/showthread...hreadid=512340



  #5   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Dates formatted as text

Let's say in A1 we have Jan-01-06 as a text string

In B1 put =MID(A1,5,3)&LEFT(A1,4)&"20"&RIGHT(A1,2)
you will see 01-Jan-2006

While this may not seem like a big improvement, it is something that
datevalue can handle.

In C1 put =DATEVALUE(B1) and you will see 38718
format as date to see: 1/1/2006


You can use C1 as a real date and perform math on it.


--
Gary''s Student


"thekovinc" wrote:


Hello. I am currently having a problem with text/dates. I am importing
data from another file that is completely text formatted. Some of the
columns in this file contain dates in the form of "Jan-01-06," and it
is always "MMM-DD-YY."

I am trying to find the difference between two of these dates, but it
will not work because of the text formatting.

ie. A formula that would output the difference between Jan-16-06 and
Jan-12-06 (the answer would be 4 days).

I am wondering if there is any easy way to convert them to dates
(changing format does not work). I have thought about just using the
LEFT command to grab the middle two numbers for the date, but that does
not take into consideration month or year changes.

Please let me know if you can help. Thanks in advance!

Nick


--
thekovinc
------------------------------------------------------------------------
thekovinc's Profile: http://www.excelforum.com/member.php...o&userid=29378
View this thread: http://www.excelforum.com/showthread...hreadid=512340




  #6   Report Post  
Posted to microsoft.public.excel.misc
thekovinc
 
Posts: n/a
Default Dates formatted as text


Thanks a lot!


--
thekovinc
------------------------------------------------------------------------
thekovinc's Profile: http://www.excelforum.com/member.php...o&userid=29378
View this thread: http://www.excelforum.com/showthread...hreadid=512340

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
imported text data converting to dates ajd Excel Discussion (Misc queries) 2 December 21st 05 06:48 PM
Reformatting dates as text AmyTaylor Excel Worksheet Functions 1 November 11th 05 11:25 AM
Converting Text months to sortable Numbers or Dates Greg Excel Discussion (Misc queries) 6 May 1st 05 03:32 AM
Converting text to dates Jack Excel Discussion (Misc queries) 2 April 25th 05 07:36 PM
Convert text to dates Ket Excel Worksheet Functions 5 November 4th 04 08:03 PM


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