Check if a time is past a certain time

S

Savio

If i have a time entered in a cell say A1, how can i check if the time
is past a certain time say 5:00pm using an if statement?
thanks
 
L

Lars-Åke Aspelin

Or how can i check if the current time is past a certain time say 5pm?

Try this:

=IF(MOD(NOW(),1)>TIME(17,0,0),"later than 17","not later than 17")

Hope this helps / Lars-Åke
 
C

Chip Pearson

=IF(HOUR(A1)>=17,"5 PM or later","Not yet 5PM")

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
 
Top