Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Newbie With A Question | Excel Worksheet Functions | |||
Anybody Help with previous question | Excel Discussion (Misc queries) | |||
Hints And Tips For New Posters In The Excel Newsgroups | Excel Worksheet Functions | |||
Question about combining data from multiple workbooks into one rep | Excel Discussion (Misc queries) | |||
An easy macro question and one I believe to be a little more diffi | Excel Worksheet Functions |