Skip to main content
Solved

Conditional IF with Date Check


Hi,

I am a little confused with exactly how to write an IF statement that checks that all three of the following conditions are true:

  1. {Status} = “”
  2. {Replacement Required} = “Yes”
  3. IF(NOW() > WORKDAY({Date Created},2)

I have the first two worked out, but when I try to add the third condition I am struggling to get it to work.

Any assistance gratefully received.

Best answer by Justin_Barrett

I think the IF() in your initial parameters was slightly misleading. You don’t need the IF around it for it to work. I think this should do the trick:

IF(
    AND(
        {Status}="",
        {Replacement Required}="Yes",
        NOW() > WORKDAY({Date Created}, 2)
    ),
    "true condition",
    "false condition"
)

You might need to change the names of the fields in the formula to match your actual fields, as your screenshot shows different names.

View original
Did this topic help you find an answer to your question?

5 replies

Kamille_Parks11
Forum|alt.badge.img+25

Try something like this:
IF(AND({Status}="", {Replacement Required}="Yes", IF(NOW()>WORKDAY({Date Created}, 2)), "true condition", "false condition")


  • Author
  • Known Participant
  • 16 replies
  • July 3, 2020
Kamille_Parks11 wrote:

Try something like this:
IF(AND({Status}="", {Replacement Required}="Yes", IF(NOW()>WORKDAY({Date Created}, 2)), "true condition", "false condition")


Thanks for the response. I needed to put in an extra bracket and now have:

IF(AND({Status}="", {Replacement Required}=“Yes”, IF(NOW()>WORKDAY({Date Created}, 2))), “true condition”, “false condition”)

The strange thing is I get “false condition” returned in all cases. I have broken down all three components of the test and can see that there are rows that should return true. Any ideas?


  • Author
  • Known Participant
  • 16 replies
  • July 3, 2020
Dominic_Rannie wrote:

Thanks for the response. I needed to put in an extra bracket and now have:

IF(AND({Status}="", {Replacement Required}=“Yes”, IF(NOW()>WORKDAY({Date Created}, 2))), “true condition”, “false condition”)

The strange thing is I get “false condition” returned in all cases. I have broken down all three components of the test and can see that there are rows that should return true. Any ideas?


In case my last response was confusing, I have made visible the columns actually referred to in the formula.


Justin_Barrett
Forum|alt.badge.img+20

I think the IF() in your initial parameters was slightly misleading. You don’t need the IF around it for it to work. I think this should do the trick:

IF(
    AND(
        {Status}="",
        {Replacement Required}="Yes",
        NOW() > WORKDAY({Date Created}, 2)
    ),
    "true condition",
    "false condition"
)

You might need to change the names of the fields in the formula to match your actual fields, as your screenshot shows different names.


  • Author
  • Known Participant
  • 16 replies
  • July 4, 2020
Justin_Barrett wrote:

I think the IF() in your initial parameters was slightly misleading. You don’t need the IF around it for it to work. I think this should do the trick:

IF(
    AND(
        {Status}="",
        {Replacement Required}="Yes",
        NOW() > WORKDAY({Date Created}, 2)
    ),
    "true condition",
    "false condition"
)

You might need to change the names of the fields in the formula to match your actual fields, as your screenshot shows different names.


Thanks Justin! That worked a treat.


Reply