If Statement with Time

G

Guest

I am trying to write IF THEN Statement using time numbers (i.e. 16:00, 13:30,
6:30). It doesn't appear to be working. Here is a sample

=IF(AND(E4<17,E4>4),"NP", "P") where E4 is a cell that contains the
military time. I keep only getting a value of P returned even when it should
be NP. I tried using 17:00 and 4:00 in the statement and got an error
 
F

Frank Kabel

Hi
try
=IF(AND(E4<17/24,E4>4/24),"NP", "P")

or
=IF(AND(E4<TIME(17,0),E4>TIME(4,0)),"NP", "P")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top