now function

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

I got a cell A1 with a now function =now() which gives the current time.
Cell A2 has a time that is entered, and cell A3 has an if function that
compared if(A1>A2,"","Do Something"). However, the if statement is true all
the time even if the time is cell A2 is a later time than A1. I changed the
format in cell A1 from a time format to a general and it turn out to be a
big number. Otherwise, I changed the time format in cell A2 into general
and it is a very small decimal number. How do I get around this, may with a
mod function or something?
 
Hi Richard

In testing your example
A1 = Now() - Returns Date/Time
Using the same custom format for A1 in A2 - dd/mm/yyyy hh:mm

Using the If formula - IF(A1>A2,TRUE, FALSE)
works every time

Is it possible the the format of Cell A2 might be affecting the calculation?
 
I got a cell A1 with a now function =now() which gives the current time.
Cell A2 has a time that is entered, and cell A3 has an if function that
compared if(A1>A2,"","Do Something"). However, the if statement is true all
the time even if the time is cell A2 is a later time than A1. I changed the
format in cell A1 from a time format to a general and it turn out to be a
big number. Otherwise, I changed the time format in cell A2 into general
and it is a very small decimal number. How do I get around this, may with a
mod function or something?

This is a bit cumbersome, but it works ok. Press the F9 key at any
time to update the time displayed in C1

A1 =HOUR(NOW())
B1 =MINUTE(NOW())
C1 =TIME(A1;B1;0)

A2 Hour entered by operator (0 - 23)
B2 Minute entered by operator (0 - 59)
C2 =TIME(A2;B2;0)

A3 =IF(C2>C1;"Later";"Earlier")
 
Back
Top