Help

Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

How to fix a combined nested IF and WORKDAY formula

Topic Labels: Formulas
Solved
Jump to Solution
375 2
cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to create a formula that adds x number of business days if priority is x.

This is what I have so far:

IF(Priority=“High”,WORKDAY({Writer Assignment Date},3,
IF(Priority=“Normal”,WORKDAY({Writer Assignment Date},5, IF(Priority=“Low”,WORKDAY({Writer Assignment Date},10))))))

It accepts this formula, but populates with an “#ERROR” in some fields and blank in others. All fields have the required selections.

Trying to create a due date field that is customized by priority. If it is high priority for instance, the person would need to complete the assignment within 3 business days by that date.

1 Solution

Accepted Solutions

Your closing parenthesis for the WORKDAY() function is in the wrong place in the first two cases. It should close after the number, not at the end of the formula. What you’re doing is nesting the next IF() function inside the WORKDAY() function, which is causing those errors.

Reworking the formula to fix those, it should look like this:

IF(Priority="High", WORKDAY({Writer Assignment Date}, 3),
IF(Priority="Normal", WORKDAY({Writer Assignment Date}, 5), IF(Priority="Low", WORKDAY({Writer Assignment Date},10))))

However, this could be greatly simplified. All that you’re changing is the value passed to WORKDAY(), and it’s all based on what is selected in {Priority}. With that in mind, you could use the SWITCH() function nested inside a single WORKDAY() function.

WORKDAY(
  {Writer Assignment Date},
  SWITCH(
    Priority,
    "High", 3,
    "Normal", 5,
    "Low", 10
  )
)

See Solution in Thread

2 Replies 2

Your closing parenthesis for the WORKDAY() function is in the wrong place in the first two cases. It should close after the number, not at the end of the formula. What you’re doing is nesting the next IF() function inside the WORKDAY() function, which is causing those errors.

Reworking the formula to fix those, it should look like this:

IF(Priority="High", WORKDAY({Writer Assignment Date}, 3),
IF(Priority="Normal", WORKDAY({Writer Assignment Date}, 5), IF(Priority="Low", WORKDAY({Writer Assignment Date},10))))

However, this could be greatly simplified. All that you’re changing is the value passed to WORKDAY(), and it’s all based on what is selected in {Priority}. With that in mind, you could use the SWITCH() function nested inside a single WORKDAY() function.

WORKDAY(
  {Writer Assignment Date},
  SWITCH(
    Priority,
    "High", 3,
    "Normal", 5,
    "Low", 10
  )
)

This worked! Thank you