Skip to main content

I have a formula which calculates the # of days between two dates. I want to add if the resulting value is <0, then the value should be set to 0, otherwise, keep the value. 

This is the calculate of two dates. How do i add the second part? I tried nesting, but that didnt work, 

F(
  OR({🚩Workflow Status} = "Complete",{🚩Workflow Status}"Released to Customer"),
  DATETIME_DIFF({🚩Actual Eng. Delivery Date},{🚩Original Planned P50 Date},'days')
  ,"")

Hey @rfscott2016

I haven't tested this, but this is generally what you're looking for:

IF(
OR(
{🚩Workflow Status} = "Complete",
{🚩Workflow Status} = "Released to Customer"
),
IF(
DATETIME_DIFF(
{🚩Actual Eng. Delivery Date},
{🚩Original Planned P50 Date},
'days'
) < 0,
0,
DATETIME_DIFF(
{🚩Actual Eng. Delivery Date},
{🚩Original Planned P50 Date},
'days'
)
)
)

Reply