Is it possible to use this formula, to state true if between two different times. =IF(TEXT(B2,"hh:mm:ss")<="15:00:00","TRUE","FALSE")

I have adapted it as shown above, but I would like to work out if between 15:00:00 and 22:59:59.

Thanks

Joejo

if between 15:00:00 and 22:59:59Try this:

=IF(AND(TEXT(B2,"hh:mm:ss")>="15:00:00",TEXT(B2,"hh:mm:ss")<="22:59:59"),"TRUE","FALSE")

See how that works for you.

MIKE

Just FYI and for educational purposes only... These 2 formulas may return a

visibly matchingresult, but the results are not actually the same:=IF(AND(TEXT(B2,"hh:mm:ss")>="15:00:00",TEXT(B2,"hh:mm:ss")<="22:59:59"),"TRUE","FALSE")

=IF(AND(TEXT(B2,"hh:mm:ss")>="15:00:00",TEXT(B2,"hh:mm:ss")<="22:59:59"),TRUE,FALSE)

The first formula returns the Text strings TRUE and FALSE while the second formula returns the Logical values TRUE and FALSE.

Just for fun, try these 2 formulas and watch what happens:

="TRUE" + 1

=TRUE + 1

How To Post Data or Code ---> Click Here Before Posting Data or VBA Code

Ask Your Question

Weekly Poll