DATEVALUE gives #VALUE! error

H

hmm

I have in cell A25 the text "- 6/19/2007 6:22:12 PM". The formula

=DATEVALUE((TRIM(MID(A25,FIND("-",A25)+3,11))))

is giving me a #VALUE! error.

How can I get it to return the correct date?
 
T

Toppers

Was the text imported into Excel?

Copying your data, I got the same error as the text string for DATEVALUE had
an extra character [non-viewable] on the end.

using this formula, I got the date returned:

=DATEVALUE((TRIM(MID(SUBSTITUTE(A1,CHAR(160)," "),FIND("-",A1)+3,11))))

This suggests are are "hidden" ("char(160)") characters in the string which
the formula substitutes with blank and hence TRIM works.

HTH
 
H

hmm

Thanks Toppers. However, I still get the error.

Any other ideas?

Toppers said:
Was the text imported into Excel?

Copying your data, I got the same error as the text string for DATEVALUE had
an extra character [non-viewable] on the end.

using this formula, I got the date returned:

=DATEVALUE((TRIM(MID(SUBSTITUTE(A1,CHAR(160)," "),FIND("-",A1)+3,11))))

This suggests are are "hidden" ("char(160)") characters in the string which
the formula substitutes with blank and hence TRIM works.

HTH

hmm said:
I have in cell A25 the text "- 6/19/2007 6:22:12 PM". The formula

=DATEVALUE((TRIM(MID(A25,FIND("-",A25)+3,11))))

is giving me a #VALUE! error.

How can I get it to return the correct date?
 
T

Toppers

Can you send me sample?

toppers <at> johntopley.fsnet.co.uk

hmm said:
Thanks Toppers. However, I still get the error.

Any other ideas?

Toppers said:
Was the text imported into Excel?

Copying your data, I got the same error as the text string for DATEVALUE had
an extra character [non-viewable] on the end.

using this formula, I got the date returned:

=DATEVALUE((TRIM(MID(SUBSTITUTE(A1,CHAR(160)," "),FIND("-",A1)+3,11))))

This suggests are are "hidden" ("char(160)") characters in the string which
the formula substitutes with blank and hence TRIM works.

HTH

hmm said:
I have in cell A25 the text "- 6/19/2007 6:22:12 PM". The formula

=DATEVALUE((TRIM(MID(A25,FIND("-",A25)+3,11))))

is giving me a #VALUE! error.

How can I get it to return the correct date?
 

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

Similar Threads


Top