Help

If statement taking the results of the first IF

Topic Labels: Formulas
Solved
Jump to Solution
563 1
cancel
Showing results for 
Search instead for 
Did you mean: 
rfscott2016
6 - Interface Innovator
6 - Interface Innovator

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')
  ,"")
1 Solution

Accepted Solutions
Ben_Young1
11 - Venus
11 - Venus

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'
        )
    )
)

See Solution in Thread

1 Reply 1
Ben_Young1
11 - Venus
11 - Venus

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'
        )
    )
)