View Single Post
  #2   Report Post  
David McRitchie
 
Posts: n/a
Default

Hi montagu,

The syntax for both IF and AND differs between
Worksheet Functions and VBA.

something like the following is invalid in any language, I've used
6:00am<6:00am11:00am,
also you asked for your value to be less than 6AM and greater than 11AM
in your formula. I expect you mean to fall between those two values.

syntax:
=IF(AND(condition1,condition2), true, false)

possible solution to your question
=IF(AND(A1=TIME(6,0,0),A1<TIME(11,0,0)), "within range", "out of range")

suggest you look in HELP for more information on both
IF Worksheet Function
AND Worksheet Function
now that you should be able to read it better.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"montagu" wrote in message
...

=if(6:00am<6:00am,true,false)=false And
=if(6:00am11:00am,true,false)=false. Why Do I Get This Result When I
Perform The Following Calculation
=if(6:00am<6:00am11:00am,true,false)=true. Can Someone Tell Me What I
Am Doing Incorrectly.


--
montagu
------------------------------------------------------------------------
montagu's Profile: http://www.excelforum.com/member.php...o&userid=15227
View this thread: http://www.excelforum.com/showthread...hreadid=399029