Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Carol
 
Posts: n/a
Default DATEVALUE QUESTION

I want to convert an entered date using the DATEVALUE funtion to a number.
EX: =Datevalue("8/22/2004") .. However, when I substitute "8/22/2004" for
a cell reference, it won't work. Ex: =Datevalue(B2)

Any ideas please? Thank you!
  #2   Report Post  
Duke Carey
 
Posts: n/a
Default

Does B2 contain a text representation of a date, or the date itself?

Sounds like it's the date itself, in which case you can simply refer to the
cell itself (i.e., =B2) as it is already a date serial number.


"Carol" wrote:

I want to convert an entered date using the DATEVALUE funtion to a number.
EX: =Datevalue("8/22/2004") .. However, when I substitute "8/22/2004" for
a cell reference, it won't work. Ex: =Datevalue(B2)

Any ideas please? Thank you!

  #3   Report Post  
JE McGimpsey
 
Posts: n/a
Default

If B2 already contains a date, use it as is:

=B2

DATEVALUE will only convert Text. I assume by "won't work" you mean you
get the #VALUE! error, which indicates you're trying to convert numbers
or text that can't be interpreted as a date. If that's not the case,
please post back stating what "won't work" means.


In article ,
"Carol" wrote:

I want to convert an entered date using the DATEVALUE funtion to a number.
EX: =Datevalue("8/22/2004") .. However, when I substitute "8/22/2004" for
a cell reference, it won't work. Ex: =Datevalue(B2)

Any ideas please? Thank you!

  #4   Report Post  
William Horton
 
Posts: n/a
Default

The DATEVALUE function requires that the data type of the argument you enter
to be a TEXT data type. Therefore, if you adjust your formula to the below
it should work for you.

=DATEVALUE(TEXT(B2,"mm/dd/yy"))

If 8/22/2004 is in cell B2 the above formula will produce an answer of 38221.

Hope this helps.

Thanks,
Bill Horton

"Carol" wrote:

I want to convert an entered date using the DATEVALUE funtion to a number.
EX: =Datevalue("8/22/2004") .. However, when I substitute "8/22/2004" for
a cell reference, it won't work. Ex: =Datevalue(B2)

Any ideas please? Thank you!

  #5   Report Post  
Carol
 
Posts: n/a
Default

THANKS MUCH!!!

"William Horton" wrote:

The DATEVALUE function requires that the data type of the argument you enter
to be a TEXT data type. Therefore, if you adjust your formula to the below
it should work for you.

=DATEVALUE(TEXT(B2,"mm/dd/yy"))

If 8/22/2004 is in cell B2 the above formula will produce an answer of 38221.

Hope this helps.

Thanks,
Bill Horton

"Carol" wrote:

I want to convert an entered date using the DATEVALUE funtion to a number.
EX: =Datevalue("8/22/2004") .. However, when I substitute "8/22/2004" for
a cell reference, it won't work. Ex: =Datevalue(B2)

Any ideas please? Thank you!

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
Newbie With A Question Michael Excel Worksheet Functions 0 July 28th 05 11:50 PM
Anybody Help with previous question Anthony Excel Discussion (Misc queries) 1 July 26th 05 01:26 PM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM
Question about combining data from multiple workbooks into one rep BookOpenandUpright Excel Discussion (Misc queries) 2 February 19th 05 12:37 PM
An easy macro question and one I believe to be a little more diffi TroutKing Excel Worksheet Functions 3 January 18th 05 09:17 PM


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