Greater than AND Less than Time Q

S

Seanie

How could I construct a formula that checks if the Current Time is
Greater than 7:00pm and Less than 12:00am
 
P

Pete_UK

12:00am meaning midnight?

Try this:

=IF(TIME(A1)>19/24,"yes","no")

No need to test for the other condition.

But, if you were interested in, say, times greater than 7:00pm and
times less than 10:00pm, then you would have this:

=IF(AND(TIME(A1)>19/24,TIME(A1)<22/24),"yes","no")

Note the use of the 24-hour clock.

Hope this helps.

Pete
 
D

DILipandey

Hi Seanie,

Assuming you have the current time in cell A1, write 7:00:00 PM in B1 and
11:59:59 PM in B2. After entering, both of them will appear as
19:00
23:59, respectively,

Now apply the following formula.

=IF(AND(A1>B1,A1<B2),"Yes","No")
Hope it helps.
--
Dilip Kumar Pandey
MBA, BCA, B.Com(Hons.)
(e-mail address removed)
(e-mail address removed)
New Delhi, India
 

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