Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 170
Default convert a text date to a true date

I am out of ideas. Excel„¢ XP on WinnXP.
I have acquired a spreadsheet "database" from another user. approximayely 5K
records with dates in the dddd, m-d-yy format, although these appear to be
stored as text. Changing the format does not change theway data is displayed.
Cells were originally formatted as General.

Can anyone offer a simple formula method to change these text entries into a
true date format? I am in process of importing info into an Access„¢ database.

Thanks for any suggestions
  #2   Report Post  
Posted to microsoft.public.excel.misc
tom tom is offline
external usenet poster
 
Posts: 570
Default convert a text date to a true date

I have a situation where my dates come to me as 1071114 (107 is the year, 11,
is the month and 14 is the day). I use the formula
=date(left(a1,3),mid(a1,4,2),right(a1,2)) and it converts to 11/14/2007. May
take a bit of modification but it should work for you.

Luck

"JR Hester" wrote:

I am out of ideas. Excel„¢ XP on WinnXP.
I have acquired a spreadsheet "database" from another user. approximayely 5K
records with dates in the dddd, m-d-yy format, although these appear to be
stored as text. Changing the format does not change theway data is displayed.
Cells were originally formatted as General.

Can anyone offer a simple formula method to change these text entries into a
true date format? I am in process of importing info into an Access„¢ database.

Thanks for any suggestions

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 170
Default convert a text date to a true date

Thanks Tom for that. MAybe I should be a bit more specific.
My dates are text such as
Sunday, March 3, 2002
Wednesday, April 11, 2004
Friday, December 20, 2003
and so forth.



"Tom" wrote:

I have a situation where my dates come to me as 1071114 (107 is the year, 11,
is the month and 14 is the day). I use the formula
=date(left(a1,3),mid(a1,4,2),right(a1,2)) and it converts to 11/14/2007. May
take a bit of modification but it should work for you.

Luck

"JR Hester" wrote:

I am out of ideas. Excel„¢ XP on WinnXP.
I have acquired a spreadsheet "database" from another user. approximayely 5K
records with dates in the dddd, m-d-yy format, although these appear to be
stored as text. Changing the format does not change theway data is displayed.
Cells were originally formatted as General.

Can anyone offer a simple formula method to change these text entries into a
true date format? I am in process of importing info into an Access„¢ database.

Thanks for any suggestions

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default convert a text date to a true date

If these are indeed TEXT entries you can use Text to Columns to convert
them. You'll lose the dddd portion but retain the date portion.

Select the range of cells in question
Goto the menu DataText to Columns
Select DelimitedNextselect both Comma and SpaceNext
In Step 3 the first partition should be highlighted in the data preview box.
Select Do not import
Finish

--
Biff
Microsoft Excel MVP


"JR Hester" wrote in message
...
I am out of ideas. ExcelT XP on WinnXP.
I have acquired a spreadsheet "database" from another user. approximayely
5K
records with dates in the dddd, m-d-yy format, although these appear to be
stored as text. Changing the format does not change theway data is
displayed.
Cells were originally formatted as General.

Can anyone offer a simple formula method to change these text entries into
a
true date format? I am in process of importing info into an AccessT
database.

Thanks for any suggestions



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default convert a text date to a true date

Assuming your first date is in A2, put this formula in the 2nd row of a help
column...

=DATE(RIGHT(A2,2),MID(A2,FIND("-",A2)-2,2),MID(A2,FIND("-",A2)+1,LEN(A2)-3-FIND("-",A2)))

and copy it down through all the rows that have dates in them. Then select
all the dates in this helper column and Edit/Copy (or Ctrl+C) them; then
select A2 (the first cell containing the original date) and click
Edit/PasteSpecial in Excel's menu bar; select Values from the option list
and hit OK; then delete the helper column and format the newly copied dates
however you want them to look.

Rick


"JR Hester" wrote in message
...
I am out of ideas. Excel„¢ XP on WinnXP.
I have acquired a spreadsheet "database" from another user. approximayely
5K
records with dates in the dddd, m-d-yy format, although these appear to be
stored as text. Changing the format does not change theway data is
displayed.
Cells were originally formatted as General.

Can anyone offer a simple formula method to change these text entries into
a
true date format? I am in process of importing info into an Access„¢
database.

Thanks for any suggestions




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default convert a text date to a true date

On Wed, 14 Nov 2007 14:36:02 -0800, JR Hester
wrote:

I am out of ideas. Excel™ XP on WinnXP.
I have acquired a spreadsheet "database" from another user. approximayely 5K
records with dates in the dddd, m-d-yy format, although these appear to be
stored as text. Changing the format does not change theway data is displayed.
Cells were originally formatted as General.

Can anyone offer a simple formula method to change these text entries into a
true date format? I am in process of importing info into an Access™ database.

Thanks for any suggestions



=--MID(A1,FIND(",",A1)+2,255)

Format as date
--ron
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default convert a text date to a true date

Hmmm...

with dates in the dddd, m-d-yy format


My dates are text such as Sunday, March 3, 2002
Wednesday, April 11, 2004


Well, I went by your first post:

with dates in the dddd, m-d-yy format


Meaning: Wednesday, 11/14/07

So, I don't think T to C will work on

My dates are text such as Sunday, March 3, 2002
Wednesday, April 11, 2004



--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
If these are indeed TEXT entries you can use Text to Columns to convert
them. You'll lose the dddd portion but retain the date portion.

Select the range of cells in question
Goto the menu DataText to Columns
Select DelimitedNextselect both Comma and SpaceNext
In Step 3 the first partition should be highlighted in the data preview
box.
Select Do not import
Finish

--
Biff
Microsoft Excel MVP


"JR Hester" wrote in message
...
I am out of ideas. ExcelT XP on WinnXP.
I have acquired a spreadsheet "database" from another user. approximayely
5K
records with dates in the dddd, m-d-yy format, although these appear to
be
stored as text. Changing the format does not change theway data is
displayed.
Cells were originally formatted as General.

Can anyone offer a simple formula method to change these text entries
into a
true date format? I am in process of importing info into an AccessT
database.

Thanks for any suggestions





  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default convert a text date to a true date

Given the different date format that you just posted in JR Hester's
subthread, use this formula in the help column using the procedure I
outlined instead of the formula I originally posted...

=--SUBSTITUTE(A2,LEFT(A2,FIND(" ",A2)),"")

Rick


"Rick Rothstein (MVP - VB)" wrote in
message ...
Assuming your first date is in A2, put this formula in the 2nd row of a
help column...

=DATE(RIGHT(A2,2),MID(A2,FIND("-",A2)-2,2),MID(A2,FIND("-",A2)+1,LEN(A2)-3-FIND("-",A2)))

and copy it down through all the rows that have dates in them. Then select
all the dates in this helper column and Edit/Copy (or Ctrl+C) them; then
select A2 (the first cell containing the original date) and click
Edit/PasteSpecial in Excel's menu bar; select Values from the option list
and hit OK; then delete the helper column and format the newly copied
dates however you want them to look.

Rick


"JR Hester" wrote in message
...
I am out of ideas. Excel„¢ XP on WinnXP.
I have acquired a spreadsheet "database" from another user. approximayely
5K
records with dates in the dddd, m-d-yy format, although these appear to
be
stored as text. Changing the format does not change theway data is
displayed.
Cells were originally formatted as General.

Can anyone offer a simple formula method to change these text entries
into a
true date format? I am in process of importing info into an Access„¢
database.

Thanks for any suggestions



  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default convert a text date to a true date

Rick,

this doesn't work in the UK, as

March 3, 2002

is not a valid date string. I'll post my solution direct to the OP.

Pete

On Nov 14, 11:08 pm, "Rick Rothstein \(MVP - VB\)"
wrote:
Given the different date format that you just posted in JR Hester's
subthread, use this formula in the help column using the procedure I
outlined instead of the formula I originally posted...

=--SUBSTITUTE(A2,LEFT(A2,FIND(" ",A2)),"")

Rick

"Rick Rothstein (MVP - VB)" wrote in
l...



Assuming your first date is in A2, put this formula in the 2nd row of a
help column...


=DATE(RIGHT(A2,2),MID(A2,FIND("-",A2)-2,2),MID(A2,FIND("-",A2)+1,LEN(A2)-3--FIND("-",A2)))


and copy it down through all the rows that have dates in them. Then select
all the dates in this helper column and Edit/Copy (or Ctrl+C) them; then
select A2 (the first cell containing the original date) and click
Edit/PasteSpecial in Excel's menu bar; select Values from the option list
and hit OK; then delete the helper column and format the newly copied
dates however you want them to look.


Rick


"JR Hester" wrote in message
...
I am out of ideas. Excel(tm) XP on WinnXP.
I have acquired a spreadsheet "database" from another user. approximayely
5K
records with dates in the dddd, m-d-yy format, although these appear to
be
stored as text. Changing the format does not change theway data is
displayed.
Cells were originally formatted as General.


Can anyone offer a simple formula method to change these text entries
into a
true date format? I am in process of importing info into an Access(tm)
database.


Thanks for any suggestions- Hide quoted text -


- Show quoted text -


  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 229
Default convert a text date to a true date

Assuming the date text is in I11:

=DATEVALUE(RIGHT(I11,LEN(I11)-FIND("^^",SUBSTITUTE(I11,",","^^",
1))-1))

Will work for all three examples cited, as well as others I can think
of. The requirement is that the weekday name be followed by a comma,
and the rest of the string an Excel-recognized date display. For
instance, these will all work:

Monday, 3/3/02
Monday, Aug 10 (assumes current year)
randomtext, Aug-12 (assumes current year)
randomtext, Aug 12, 2005

Will work also for differing regional setting, assuming the weekday
followed by comma requirement is met.

On Nov 14, 5:56 pm, JR Hester
wrote:
Thanks Tom for that. MAybe I should be a bit more specific.
My dates are text such as
Sunday, March 3, 2002
Wednesday, April 11, 2004
Friday, December 20, 2003
and so forth.



"Tom" wrote:
I have a situation where my dates come to me as 1071114 (107 is the year, 11,
is the month and 14 is the day). I use the formula
=date(left(a1,3),mid(a1,4,2),right(a1,2)) and it converts to 11/14/2007. May
take a bit of modification but it should work for you.


Luck


"JR Hester" wrote:


I am out of ideas. Excel(tm) XP on WinnXP.
I have acquired a spreadsheet "database" from another user. approximayely 5K
records with dates in the dddd, m-d-yy format, although these appear to be
stored as text. Changing the format does not change theway data is displayed.
Cells were originally formatted as General.


Can anyone offer a simple formula method to change these text entries into a
true date format? I am in process of importing info into an Access(tm) database.


Thanks for any suggestions- Hide quoted text -


- Show quoted text -




  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default convert a text date to a true date

You may have seen debates here in the past about using DATE and
DATEVALUE - the problem with the latter (taking strings) is the
regional variations in strings that are recognised as dates in
different countries, so solutions may not work universally. Bearing
this in mind, I would propose the following:

First of all, set up a table of months and the month number, like
this:

Jan 1
Feb 2
Mar 3
Apr 4
May 5
Jun 6
Jul 7
Aug 8
Sep 9
Oct 10
Nov 11
Dec 12

It doesn't really matter where this is (I put mine in M4:N15), but you
should give the table a name like "months" by highlighting the data
and Insert | Name | Define. Then, if your text date is in K4 in the
format you spelled out in your second post, you can use this formula
to convert it to a proper date:

=DATE(RIGHT(K4,4),VLOOKUP(MID(K4,FIND(",",K4)+2,3) ,months,
2,0),MID(K4,LEN(K4)-7,2))

Obviously, adjust the references to K4 to suit your first cell.

Format the cell appropriately, and then copy down if you have other
dates in column K.

The formula should work whichever country you are in.

Hope this helps.

Pete




On Nov 14, 10:56 pm, JR Hester
wrote:
Thanks Tom for that. MAybe I should be a bit more specific.
My dates are text such as
Sunday, March 3, 2002
Wednesday, April 11, 2004
Friday, December 20, 2003
and so forth.



"Tom" wrote:
I have a situation where my dates come to me as 1071114 (107 is the year, 11,
is the month and 14 is the day). I use the formula
=date(left(a1,3),mid(a1,4,2),right(a1,2)) and it converts to 11/14/2007. May
take a bit of modification but it should work for you.


Luck


"JR Hester" wrote:


I am out of ideas. Excel(tm) XP on WinnXP.
I have acquired a spreadsheet "database" from another user. approximayely 5K
records with dates in the dddd, m-d-yy format, although these appear to be
stored as text. Changing the format does not change theway data is displayed.
Cells were originally formatted as General.


Can anyone offer a simple formula method to change these text entries into a
true date format? I am in process of importing info into an Access(tm) database.


Thanks for any suggestions- Hide quoted text -


- Show quoted text -


  #12   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default convert a text date to a true date

this doesn't work in the UK, as

March 3, 2002

is not a valid date string. I'll post my solution direct to the OP.


Really? I have no experience with international units, but I figured the
Excel date engine would work the same as the VB/VBA date engine... if the
date engine could interpret something as a date in **any** possible way,
then that is how it interprets it. I'm guessing, based on your posting, that
for the Excel spreadsheet world, this is not the case. Thanks for letting me
know.

Rick

  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default convert a text date to a true date

I only discovered this a couple of days ago when a poster from the US
sent me a file to look at and all his dates came up as #VALUE, so I
had to change his formulae from DATEVALUE to DATE before I could look
into the problem he had asked me to look at - so, it was fresh in my
mind!!

We normally enter dates here as day first followed by month and then
year, so 3 March or 3 March 2007 are recognised, but March 3 2007 or
March 3, 2007 are not, and are treated as strings.

So, you learn something new every day <bg

Pete

On Nov 15, 4:32 am, "Rick Rothstein \(MVP - VB\)"
wrote:
this doesn't work in the UK, as


March 3, 2002


is not a valid date string. I'll post my solution direct to the OP.


Really? I have no experience with international units, but I figured the
Excel date engine would work the same as the VB/VBA date engine... if the
date engine could interpret something as a date in **any** possible way,
then that is how it interprets it. I'm guessing, based on your posting, that
for the Excel spreadsheet world, this is not the case. Thanks for letting me
know.

Rick


  #14   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default convert a text date to a true date

We normally enter dates here as day first followed by month and then
year, so 3 March or 3 March 2007 are recognised, but March 3 2007 or
March 3, 2007 are not, and are treated as strings.


I knew you guys wrote your dates backwards<g, but VB/VBA will still
interpret them as dates here. Likewise, if you go into the VBA editor and
type/enter this...

Print IsDate("March 3, 2007")

in the Immediate window, it will print True just like if I type/enter
this...

Print IsDate("3 March 2007")

here, it too will print True. VB/VBA will accept anything that is considered
a date anywhere in the world as a date in any locale (within Date functions,
of course). I just figured the same date engine was at work within the Excel
spreadsheet world as well.

So, you learn something new every day <bg


Yep... I did with this thread. Thanks again for pointing it out to me.

Rick

  #15   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default convert a text date to a true date

Yes, I can confirm that

Print IsDate("March 3, 2007")

in the Immediate window does produce True, so obviously there is a
difference between the way VBA and spreadsheet functions handle dates.

Pete

On Nov 15, 9:57 am, "Rick Rothstein \(MVP - VB\)"
wrote:
We normally enter dates here as day first followed by month and then
year, so 3 March or 3 March 2007 are recognised, but March 3 2007 or
March 3, 2007 are not, and are treated as strings.


I knew you guys wrote your dates backwards<g, but VB/VBA will still
interpret them as dates here. Likewise, if you go into the VBA editor and
type/enter this...

Print IsDate("March 3, 2007")

in the Immediate window, it will print True just like if I type/enter
this...

Print IsDate("3 March 2007")

here, it too will print True. VB/VBA will accept anything that is considered
a date anywhere in the world as a date in any locale (within Date functions,
of course). I just figured the same date engine was at work within the Excel
spreadsheet world as well.

So, you learn something new every day <bg


Yep... I did with this thread. Thanks again for pointing it out to me.

Rick




  #16   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default convert a text date to a true date

On Wed, 14 Nov 2007 17:39:27 -0800 (PST), Pete_UK wrote:

Rick,

this doesn't work in the UK, as

March 3, 2002

is not a valid date string. I'll post my solution direct to the OP.

Pete


Thanks for pointing that out, Pete. I just confirmed it here by changing my
Regional settings to UK.
--ron
  #17   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default convert a text date to a true date

Nothing like consistency within the same product, eh?

Thanks for the confirmation on that.

Rick


"Pete_UK" wrote in message
...
Yes, I can confirm that

Print IsDate("March 3, 2007")

in the Immediate window does produce True, so obviously there is a
difference between the way VBA and spreadsheet functions handle dates.

Pete

On Nov 15, 9:57 am, "Rick Rothstein \(MVP - VB\)"
wrote:
We normally enter dates here as day first followed by month and then
year, so 3 March or 3 March 2007 are recognised, but March 3 2007 or
March 3, 2007 are not, and are treated as strings.


I knew you guys wrote your dates backwards<g, but VB/VBA will still
interpret them as dates here. Likewise, if you go into the VBA editor and
type/enter this...

Print IsDate("March 3, 2007")

in the Immediate window, it will print True just like if I type/enter
this...

Print IsDate("3 March 2007")

here, it too will print True. VB/VBA will accept anything that is
considered
a date anywhere in the world as a date in any locale (within Date
functions,
of course). I just figured the same date engine was at work within the
Excel
spreadsheet world as well.

So, you learn something new every day <bg


Yep... I did with this thread. Thanks again for pointing it out to me.

Rick



  #18   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default convert a text date to a true date

March 3 2007 (or Mar 3 2007) is not a valid date string in the U.S., either!
U.S. regional format - m/d/yyyy

DATEVALUE = #VALUE!

However, these are valid:

Mar 3, 2007
March 3, 2007

It seems the comma makes all the difference!

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
Nothing like consistency within the same product, eh?

Thanks for the confirmation on that.

Rick


"Pete_UK" wrote in message
...
Yes, I can confirm that

Print IsDate("March 3, 2007")

in the Immediate window does produce True, so obviously there is a
difference between the way VBA and spreadsheet functions handle dates.

Pete

On Nov 15, 9:57 am, "Rick Rothstein \(MVP - VB\)"
wrote:
We normally enter dates here as day first followed by month and then
year, so 3 March or 3 March 2007 are recognised, but March 3 2007 or
March 3, 2007 are not, and are treated as strings.

I knew you guys wrote your dates backwards<g, but VB/VBA will still
interpret them as dates here. Likewise, if you go into the VBA editor
and
type/enter this...

Print IsDate("March 3, 2007")

in the Immediate window, it will print True just like if I type/enter
this...

Print IsDate("3 March 2007")

here, it too will print True. VB/VBA will accept anything that is
considered
a date anywhere in the world as a date in any locale (within Date
functions,
of course). I just figured the same date engine was at work within the
Excel
spreadsheet world as well.

So, you learn something new every day <bg

Yep... I did with this thread. Thanks again for pointing it out to me.

Rick





  #19   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default convert a text date to a true date

On Thu, 15 Nov 2007 13:13:57 -0500, "T. Valko" wrote:

March 3 2007 (or Mar 3 2007) is not a valid date string in the U.S., either!
U.S. regional format - m/d/yyyy

DATEVALUE = #VALUE!

However, these are valid:

Mar 3, 2007
March 3, 2007

It seems the comma makes all the difference!

--
Biff
Microsoft Excel MVP


The comma does NOT make a difference if your regional settings are
English(United Kingdom). Still get the #VALUE! error
--ron
  #20   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default convert a text date to a true date

The OP specified the format (with the comma) in the second response (to JR
Hester) which is what I posted my

=--SUBSTITUTE(A2,LEFT(A2,FIND(" ",A2)),"")

formula against. Pete's first reply specifically said in his first reply to
me that..

"this doesn't work in the UK, as

March 3, 2002

is not a valid date string"

Note the comma in his message. Are you now saying that my SUBSTITUTE formula
above does, in fact, work in locales other than the US (provided the comma
is present)?

Rick


"T. Valko" wrote in message
...
March 3 2007 (or Mar 3 2007) is not a valid date string in the U.S.,
either! U.S. regional format - m/d/yyyy

DATEVALUE = #VALUE!

However, these are valid:

Mar 3, 2007
March 3, 2007

It seems the comma makes all the difference!

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
Nothing like consistency within the same product, eh?

Thanks for the confirmation on that.

Rick


"Pete_UK" wrote in message
...
Yes, I can confirm that

Print IsDate("March 3, 2007")

in the Immediate window does produce True, so obviously there is a
difference between the way VBA and spreadsheet functions handle dates.

Pete

On Nov 15, 9:57 am, "Rick Rothstein \(MVP - VB\)"
wrote:
We normally enter dates here as day first followed by month and then
year, so 3 March or 3 March 2007 are recognised, but March 3 2007 or
March 3, 2007 are not, and are treated as strings.

I knew you guys wrote your dates backwards<g, but VB/VBA will still
interpret them as dates here. Likewise, if you go into the VBA editor
and
type/enter this...

Print IsDate("March 3, 2007")

in the Immediate window, it will print True just like if I type/enter
this...

Print IsDate("3 March 2007")

here, it too will print True. VB/VBA will accept anything that is
considered
a date anywhere in the world as a date in any locale (within Date
functions,
of course). I just figured the same date engine was at work within the
Excel
spreadsheet world as well.

So, you learn something new every day <bg

Yep... I did with this thread. Thanks again for pointing it out to me.

Rick







  #21   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default convert a text date to a true date

Are you now saying that my SUBSTITUTE formula above does, in fact, work in
locales other than the US (provided the comma is present)?


No. I was simply pointing out that DATEVALUE doesn't recognize mmmm d yyyy
as a valid date string in either U.S. or UK regional settings. You would
think (at least, I would think) that mmmm d yyyy should be a valid date
string in the U.S. since it *is* a valid date format.

A1 = 3/3/2007

Custom format as mmmm d yyyy

A1 displays March 3 2007

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
The OP specified the format (with the comma) in the second response (to JR
Hester) which is what I posted my

=--SUBSTITUTE(A2,LEFT(A2,FIND(" ",A2)),"")

formula against. Pete's first reply specifically said in his first reply
to me that..

"this doesn't work in the UK, as

March 3, 2002

is not a valid date string"

Note the comma in his message. Are you now saying that my SUBSTITUTE
formula above does, in fact, work in locales other than the US (provided
the comma is present)?

Rick


"T. Valko" wrote in message
...
March 3 2007 (or Mar 3 2007) is not a valid date string in the U.S.,
either! U.S. regional format - m/d/yyyy

DATEVALUE = #VALUE!

However, these are valid:

Mar 3, 2007
March 3, 2007

It seems the comma makes all the difference!

--
Biff
Microsoft Excel MVP


"Rick Rothstein (MVP - VB)" wrote in
message ...
Nothing like consistency within the same product, eh?

Thanks for the confirmation on that.

Rick


"Pete_UK" wrote in message
...
Yes, I can confirm that

Print IsDate("March 3, 2007")

in the Immediate window does produce True, so obviously there is a
difference between the way VBA and spreadsheet functions handle dates.

Pete

On Nov 15, 9:57 am, "Rick Rothstein \(MVP - VB\)"
wrote:
We normally enter dates here as day first followed by month and then
year, so 3 March or 3 March 2007 are recognised, but March 3 2007 or
March 3, 2007 are not, and are treated as strings.

I knew you guys wrote your dates backwards<g, but VB/VBA will still
interpret them as dates here. Likewise, if you go into the VBA editor
and
type/enter this...

Print IsDate("March 3, 2007")

in the Immediate window, it will print True just like if I type/enter
this...

Print IsDate("3 March 2007")

here, it too will print True. VB/VBA will accept anything that is
considered
a date anywhere in the world as a date in any locale (within Date
functions,
of course). I just figured the same date engine was at work within the
Excel
spreadsheet world as well.

So, you learn something new every day <bg

Yep... I did with this thread. Thanks again for pointing it out to me.

Rick







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
How do I convert a fraction to its true decimal, not a date no. 2HatsMcHattie Excel Discussion (Misc queries) 2 October 15th 07 09:25 AM
how do i convert text to date (mm/yy text to mm/dd/yyyy date)? lindsey Excel Discussion (Misc queries) 1 July 27th 07 10:05 PM
Convert date + time text format to date format Paul Ho Excel Worksheet Functions 2 May 22nd 07 05:47 PM
Need true or false if a date falls between a date range dustin Excel Worksheet Functions 3 December 9th 06 02:01 AM
Help: How do I convert a text date into a real date format japorms Excel Worksheet Functions 4 August 2nd 06 06:36 PM


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