View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Time Value Between Two Times

On Tue, 13 Oct 2009 18:13:49 -0700 (PDT), Debbie
wrote:

Here is another scenario.

If F85 is greater than or equal to 8:30 am but less than or equal to
9:00 am, then I need it to return a 1, If it is not between 8:30 am
and 9:00 am then I need it to return "B". I have the cell formated as
time 00:00 AM. What am I doing wrong?

IF(AND(F85=8:30,F85<=9:00),1,"B")


It's always helpful if you explain "why" you think you are doing something
wrong. In other words, are you getting an error message? If so, what is it?

Are you getting a wrong answer? If so what is the input and output?

And so forth.

From the looks of your formula, it appears as if you are entering the Time
value incorrectly. In that case, you should be getting an error message "The
formula you typed contains an error".

If that is the case, then try this:


=IF(AND(F85=TIME(8,30,0),F85<=TIME(9,,)),1,"B")

Or, put your times in a cell, and reference those cells in your formula.

--ron