Help

Re: How to fix a combined nested IF and WORKDAY formula

Solved
Jump to Solution
938 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Aysia_Saylor
6 - Interface Innovator
6 - Interface Innovator

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
Justin_Barrett
18 - Pluto
18 - Pluto

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
Justin_Barrett
18 - Pluto
18 - Pluto

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
  )
)
Aysia_Saylor
6 - Interface Innovator
6 - Interface Innovator

This worked! Thank you