Solved Use this formula, to state true if between 2 different times

November 2, 2017 at 07:14:09
Specs: Windows 7
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


See More: Use this formula, to state true if between 2 different times

Reply ↓  Report •

#1
November 2, 2017 at 07:45:59
if between 15:00:00 and 22:59:59

Try 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

http://www.skeptic.com/


Reply ↓  Report •

#2
November 2, 2017 at 12:17:19
✔ Best Answer
Just FYI and for educational purposes only...

These 2 formulas may return a visibly matching result, 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


Reply ↓  Report •
Related Solutions


Ask Question