If statement

  • Thread starter Thread starter Doug
  • Start date Start date
D

Doug

A document generated at work has a column which contains
both a date and time in each cell. I am trying to build an
IF statement that will look at the date only and ignore
the time, then provided a specific value if it is the
current date and something else if it is not. When I
delete the time from the cell and just leave the date, the
IF statement works perfectly. When I leave the time there
the IF statement sees it as a different value and does not
work right. Since I am not the author of this report, I
can not change it to place the time in a different cell
from the date. Is there any way I can have the IF
statement ignore the time so that it just uses the date?
Doug
 
XL stores dates as integer offsets from a base date, and times as
fractional days (so 3:00 = 0.125). So to ignore times, use INT():

=IF(INT(A1)=TODAY(),"It's Today!", "It's not Today.")
 
Thanks for your help JE,
When I use INT I get a #VALUE response whether or not the
date is current. This is what I used: =IF(INT(M35)=TODAY
(),0,5). M35 is the cell that contains both the date and
time in the following format: 6/24/04 17:00.

What can I do to get a response of 0 when the date is
current and 5 when it is not.
Doug
 
That means that instead of an XL date/time, the value is Text and can't
be coerced into a date/time.

What is the exact format of the date/time?
 
The format category is general.
-----Original Message-----
That means that instead of an XL date/time, the value is Text and can't
be coerced into a date/time.

What is the exact format of the date/time?


.
 
Back
Top