Missing something with datevalue

S

Sandy

If I type (in B2) 10/10/08 and enter =DATEVALUE(B2) (in D2) I get #VALUE!
If I type (in E2) =DATEVALUE("10/10/08") I get 39731, why do I receive the
#VALUE! error?
Sandy
 
D

Dave Peterson

=datevalue() converts a string that looks like a date to a date.

If you entered 10/10/08 in the cell, then I bet you already entered a date--and
that doesn't need to be converted.

ps.

Change the format of the cell with the formula to be able to see a real date.
 
P

Peo Sjoblom

Let me start by asking what you expected the formula to return?

DATEVALUE is supposed to return a numerical date from a text expression,
if you just want the date serial number format A2 as general. It doesn't
make any sense using
DATEVALUE on a date that is already numerical.


Apart from pedagogical reasons DATEVALUE is an obsolete formula that I
suspect
was incorporated into Excel when they copied the major spreadsheet at the
time Lotus 123.

You might as well use VALUE or +0, *1, or -- to convert a date text string
into a real Excel date that can be used for calculations but using it the
way you were does not make any sense.



--


Regards,


Peo Sjoblom
 
S

Sandy

Thank you Dave
If I format the cell as text and then type in 10/10/08 it does work
Sandy
 
P

Peo Sjoblom

But why are you even using it on a regular date?

--


Regards,


Peo Sjoblom

Sandy said:
Thank you Dave
If I format the cell as text and then type in 10/10/08 it does work
Sandy
 
S

Sandy

I was just looking at how certain functions worked and for datevalue
I looked at the following webpage
http://www.techonthenet.com/excel/formulas/datevalue.php

I failed to spot however that an apostrophe had been included before
the entry in the cells showing the examples.

Naturally when I tried to replicate it - without the apostrophe -
it failed - and I couldn't see why.

Thanks for your interest though.

Sandy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top