Sunday, December 4, 2011

Is it possible to nest an IF statement in Excel using the current date as the variable?

I'd like to tell it "If today's date is greater than the date in this cell, mark the cell with this symbol, else mark it with this symbol" I sort of understand how to do IF statements with data from different cells, I just wasn't sure if you could have it query the system time and use that.|||This will work...





=IF(TODAY()%26gt;C5,"true","false")|||You can tell it "If today's date is greater than the date in THAT cell, mark this cell with this symbol, else mark it with this symbol", but you can't have a formula modify the data in the cell the formula is in; that's called a circular reference, and it's illegal. (After your way ran, the data in the cell could be "this symbol" [whatever symbol you used], rather than a date, which would make the formula blow up.)





You COULD do it with a macro, but it would only run once. Again, once the data in the cell was changed to your symbol, running the macro on that cell would throw an error (type mismatch).

No comments:

Post a Comment