Help

Discover what data silos are costing your org in our commissioned Forrester study. Learn more

Function TODAY() not always giving the exact output when used with compare symbols "<" or ">" to compare dates

Topic Labels: Formulas
106 3
cancel
Showing results for 
Search instead for 
Did you mean: 

Hi!

I had the following situation when using the following formula to compare dates and determine the current row as the current date.

  • the first part state if the count I less or equal to 1, that’s the current row,

  • then if the count is above 1 and now is greater than the start date and now is previous to next date or next date is empty, that’s the current row

IF({Count}<=1, “current”, IF(AND({Count}>1, Now() > {Start date}, OR(Now() < {Next date}, {Next date}=“”)),“current”))

This would give the correct output.

But when I tried using instead of NOW() > TODAY()

IF({Count}<=1, “current”, IF(AND({Count}>1, {TODAY()} > {Start date}, OR(TODAY() < {Next date}, {Next date}=“”)),“current”))

It would throw a completely different result, completely shift on dates.

WHY?

3 Replies 3

@Christian_Heins It seems there is a mistake in the second formula:
IF({Count}<=1, “current”, IF(AND({Count}>1, {TODAY()} > {Start date}, OR(TODAY() < {Next date}, {Next date}=“”)),“current”))
Function TODAY() should not be placed in curly braces as they denote the field name.

Sorry the formula I used was without the braces on today:

IF({Count}<=1, “current”, IF(AND({Count}>1, TODAY() > {Start date}, OR(TODAY() < {Next date}, {Next date}=“”)),“current”))

The difference is because TODAY() is set at midnight and NOW() shows the current time.
image
I slightly modified your formula to distinct different CURRENTS.

IF({Count}<=1, 'current', IF(AND({Count} > 1, TODAY() > {Start date}, OR(TODAY() < {Next date}, {Next date} = '')),'current 2','current 3'))```