Time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I write an if statement to check if its past 5:30 PM. I tried
if(hour>17.5) but that only checks the hr itself and not minutes.
Thanks,
Yosef
 
Hi,

Try this

=IF(NOW()>TIME(17,30,0),TRUE,FALSE)

This checks against your current defined system time. It will not keep
checking by itself. To update you can press the F9 key.

Hope this helps,

Matt
 
Ill try thanks - I just figured out another way. yours is much cleaner.
=IF(HOUR(NOW())>=17,IF(MINUTE(NOW())>=30,"The lock desk closed at 5:30 PM,
please lock tomorrow !!",""),"")
 
Hi,

You could also use this if the time you wish to check against is in cell A1

=IF(A1>TIME(17,30,0),TRUE,FALSE)

ThaNKS
 
OK - mine didnt work. but Im having an issue with yours as well
I typed in =IF(NOW()>TIME(17,29,0),TRUE,FALSE) but its saying true and its
only 4:26 PM ??
Am I missing something ?
Thanks
 
The reason Matt's formula fails is because NOW() at the moment is 38545
point something or other which of course is bigger than any time which will
be less than one. To make your formula work try using MOD(NOW(),1)*24 in
place of HOUR
--
HTH


Sandy
(e-mail address removed)
Replace@mailinator with @tiscali.co.uk
 
worked like a charm ! Quite smart - looking at the remainder. damn why
cant they make some of these functions a bit easier !!

thanks !
Yosef
 
=IF(((NOW()-INT(NOW()))>0.729167),"After 5:30","Not 5:30 yet")

Vaya con Dios,
Chuck, CABGx3
 
Apologies for earlier posting being wrong, meant it to be:

=IF(TIME(HOUR(NOW()),MINUTE(NOW()),SECOND(NOW()))>TIME(17,30,0),TRUE,FALSE)

Cheers,
Matt
 

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

Back
Top