Miyer
Miyer

Reputation: 365

Why is if condition now working with now()

I'm trying to work with an if condition with now() but it doesn't work no matter the now() is more or less than the fix time(). what can be the reason?

=IF(NOW()>TIME(9,25,0),"No Records","ABSENT")

Upvotes: 1

Views: 77

Answers (1)

kishkin
kishkin

Reputation: 5325

Try this:

=IF(MOD(NOW(), 1) > TIME(9, 25, 0), "No Records", "ABSENT")

Date time is a numeric value internally. Time part is decimal part, so MOD(..., 1) gives you the time part as it gives the remainder for the division by 1.

Upvotes: 1

Related Questions