If statements using less than or equal with dates

  • Thread starter Thread starter Tigers00
  • Start date Start date
T

Tigers00

So F4 and O2 below are dates in the format mm/dd/yy and I'm trying to get the
function to pull the value in column M if the statement is true. For some
reason all of the values are coming up "" blank when they shouldn't be. Can
you please help?

=IF($F4<=O$2,$M4/1000,"")
 
The date in cell F4 is probably not a true Excel date. It's probably a TEXT
string that looks like a date. In Excel daates are really just numbers
formatted to look like dates. You can test a date to see if it is in fact a
true Excel date.

=ISNUMBER(F4)

If F4 is a true Excel date that formula will return TRUE.

=COUNT(F4,O2)

If both cells contain true Excel dates that formula will return 2.

One way to fix it is to change the cell format to GENERAL then re-enter the
date. If you have a lot of cells to fix sometimes this will work:

Select the range of cells in question
Goto the menu Data>Text to Columns
Just click Finish
 
Back
Top