ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   DATEVALUE QUESTION (https://www.excelbanter.com/excel-worksheet-functions/38759-datevalue-question.html)

Carol

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!

Duke Carey

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!


JE McGimpsey

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!


William Horton

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!


Carol

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!



All times are GMT +1. The time now is 09:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com