Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default AND Headache (with dates)!

Greetings All,

I'm going crazy trying to figure out what's wrong.

In A1, I have the following:
01/30/2004

In B1, I have the following formula:
=And(A1< "02/01/2004")
which results in: TRUE (makes sense to me...)

In C1, I have the following formula:
=And(A1 "12/31/2003")
which results in: FALSE (huh?!?!)

In B2, I have the following:
=And(A1< 02/01/2004)
which results in FALSE (huh ?!?!)

In C2, I have the following:
=And(A1< 12/31/2003)
which results in TRUE (makes sense to me).

What is going on?

Thanks in advance!

--Alan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default AND Headache (with dates)!

Alan,

A1 has a date, which is a serial number, 38,016 in this case. The values in
quotes are strings, and although it would be possible to work out the actual
values compared, I won't bother, but the results do not surprise.

Try this in B1 =A1<DATE(2004,2,1), and this in C1 =A1DATE(2003,12,31, and
you will see they both resolve to True. Test like for like, and you can
predict the results.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Alan L. Wagoner" wrote in message
...
Greetings All,

I'm going crazy trying to figure out what's wrong.

In A1, I have the following:
01/30/2004

In B1, I have the following formula:
=And(A1< "02/01/2004")
which results in: TRUE (makes sense to me...)

In C1, I have the following formula:
=And(A1 "12/31/2003")
which results in: FALSE (huh?!?!)

In B2, I have the following:
=And(A1< 02/01/2004)
which results in FALSE (huh ?!?!)

In C2, I have the following:
=And(A1< 12/31/2003)
which results in TRUE (makes sense to me).

What is going on?

Thanks in advance!

--Alan




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default AND Headache (with dates)!

Bob,

DUH!

Thanks for pointing out the <somewhat obvious.

--Alan
...missing London

"Bob Phillips" wrote in message
...
Alan,

A1 has a date, which is a serial number, 38,016 in this case. The values

in
quotes are strings, and although it would be possible to work out the

actual
values compared, I won't bother, but the results do not surprise.

Try this in B1 =A1<DATE(2004,2,1), and this in C1 =A1DATE(2003,12,31, and
you will see they both resolve to True. Test like for like, and you can
predict the results.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)



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
I'm a leaner wiht a headache!! Ron@Buy Excel Worksheet Functions 2 September 13th 09 10:11 AM
Frequency Headache Rothman Excel Worksheet Functions 6 March 9th 06 09:25 PM
headache! :) unique_id's cjjoo Excel Worksheet Functions 7 October 21st 05 03:24 AM
Vlookup Headache Stressed Out!! Excel Worksheet Functions 1 September 14th 05 06:03 AM
Look up Headache Chris Excel Programming 3 November 26th 03 02:55 PM


All times are GMT +1. The time now is 12:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"