Nested IF OR limits?

I have some very involved nested IF(OR( formulas in my sheet. They all work past the initial IF, and the the first IF(OR( statement, then ignores everything past that one. I'm hoping it's just a syntax issue vs a limitation.

Here's one example:

=IF([Outsource Due Date]@row = "", IF([Route Number]@row = "FAB-WELD-NOFIN-09", WORKDAY([Assembly Start Date]@row, -4), IF(OR([Route Number]@row = "FAB-FIN-01", [Route Number]@row = "FAB-FIN-07", [Route Number]@row = "FAB-WELD-FIN-01"), WORKDAY([Collect for OS Finish Due Date]@row, -2, IF(OR([Route Number]@row = "FAB-WELD-FIN-03", [Route Number]@row = "FAB-WELD-FIN-11", [Route Number]@row = "FAB-WELD-FIN-ASSY-03", [Route Number]@row = "FAB-WELD-FIN-ASSY-11"), WORKDAY([Collect for OS Finish Due Date]@row, -2, IF(OR([Route Number]@row = "FAB-WELD-FIN-04", [Route Number]@row = "FAB-WELD-FIN-08", [Route Number]@row = "FAB-WELD-FAB-FIN-06", [Route Number]@row = "FAB-WELD-FAB-FIN-05", [Route Number]@row = "FAB-WELD-FAB-FIN-19", [Route Number]@row = "FAB-WELD-FAB-FIN-20", [Route Number]@row = "FAB-WELD-FIN-ASSY-04", [Route Number]@row = "FAB-WELD-FIN-ASSY-08", WORKDAY([Collect for OS Finish Due Date]@row, -3, IF(OR([Route Number]@row = "FAB-WELD-FIN-05", [Route Number]@row = "FAB-WELD-FIN-09", [Route Number]@row = "FAB-WELD-FAB-FIN-07", [Route Number]@row = "FAB-WELD-FAB-FIN-08", [Route Number]@row = "FAB-WELD-FAB-FIN-15", [Route Number]@row = "FAB-WELD-FAB-FIN-16", [Route Number]@row = "FAB-WELD-FIN-ASSY-05", [Route Number]@row = "FAB-WELD-FIN-ASSY-09"), WORKDAY([Collect for OS Finish Due Date]@row, -4, IF(OR([Route Number]@row = "FAB-WELD-FAB-FIN-09", [Route Number]@row = "FAB-WELD-FAB-FIN-10", [Route Number]@row = "FAB-WELD-FAB-FIN-17", [Route Number]@row = "FAB-WELD-FAB-FIN-18"), WORKDAY([Collect for OS Finish Due Date]@row, -5, IF(OR([Route Number]@row = "FAB-NOFIN-01", [Route Number]@row = "FAB-NOFIN-07"), WORKDAY([Assembly Start Date]@row, -1, IF(OR([Route Number]@row = "FAB-WELD-NOFIN-03", [Route Number]@row = "FAB-WELD-NOFIN-11"), WORKDAY([Assembly Start Date]@row, -2, IF(OR([Route Number]@row = "FAB-WELD-NOFIN-04", [Route Number]@row = "FAB-WELD-NOFIN-05", [Route Number]@row = "FAB-WELD-NOFIN-08"), WORKDAY([Assembly Start Date]@row, -3), ""))))))))))))))))), "OUTSOURCED")

Best Answer

  • Devin Lee
    Devin Lee ✭✭✭✭✭
    Answer ✓

    Hey @LakeWaconia

    You're missing closed parenthesis for some of your WORKDAY and OR statements. One easy way to check these things is to just cycle though the end parenthesis and make sure they are reference the IF false statements.

    =IF([Outsource Due Date]@row = "", IF([Route Number]@row = "FAB-WELD-NOFIN-09", WORKDAY([Assembly Start Date]@row, -4), IF(OR([Route Number]@row = "FAB-FIN-01", [Route Number]@row = "FAB-FIN-07", [Route Number]@row = "FAB-WELD-FIN-01"), WORKDAY([Collect for OS Finish Due Date]@row, -2), IF(OR([Route Number]@row = "FAB-WELD-FIN-03", [Route Number]@row = "FAB-WELD-FIN-11", [Route Number]@row = "FAB-WELD-FIN-ASSY-03", [Route Number]@row = "FAB-WELD-FIN-ASSY-11"), WORKDAY([Collect for OS Finish Due Date]@row, -2), IF(OR([Route Number]@row = "FAB-WELD-FIN-04", [Route Number]@row = "FAB-WELD-FIN-08", [Route Number]@row = "FAB-WELD-FAB-FIN-06", [Route Number]@row = "FAB-WELD-FAB-FIN-05", [Route Number]@row = "FAB-WELD-FAB-FIN-19", [Route Number]@row = "FAB-WELD-FAB-FIN-20", [Route Number]@row = "FAB-WELD-FIN-ASSY-04", [Route Number]@row = "FAB-WELD-FIN-ASSY-08"), WORKDAY([Collect for OS Finish Due Date]@row, -3), IF(OR([Route Number]@row = "FAB-WELD-FIN-05", [Route Number]@row = "FAB-WELD-FIN-09", [Route Number]@row = "FAB-WELD-FAB-FIN-07", [Route Number]@row = "FAB-WELD-FAB-FIN-08", [Route Number]@row = "FAB-WELD-FAB-FIN-15", [Route Number]@row = "FAB-WELD-FAB-FIN-16", [Route Number]@row = "FAB-WELD-FIN-ASSY-05", [Route Number]@row = "FAB-WELD-FIN-ASSY-09"), WORKDAY([Collect for OS Finish Due Date]@row, -4), IF(OR([Route Number]@row = "FAB-WELD-FAB-FIN-09", [Route Number]@row = "FAB-WELD-FAB-FIN-10", [Route Number]@row = "FAB-WELD-FAB-FIN-17", [Route Number]@row = "FAB-WELD-FAB-FIN-18"), WORKDAY([Collect for OS Finish Due Date]@row, -5), IF(OR([Route Number]@row = "FAB-NOFIN-01", [Route Number]@row = "FAB-NOFIN-07"), WORKDAY([Assembly Start Date]@row, -1), IF(OR([Route Number]@row = "FAB-WELD-NOFIN-03", [Route Number]@row = "FAB-WELD-NOFIN-11"), WORKDAY([Assembly Start Date]@row, -2), IF(OR([Route Number]@row = "FAB-WELD-NOFIN-04", [Route Number]@row = "FAB-WELD-NOFIN-05", [Route Number]@row = "FAB-WELD-NOFIN-08"), WORKDAY([Assembly Start Date]@row, -3), ""))))))))), "OUTSOURCED")
    


Answers

  • Devin Lee
    Devin Lee ✭✭✭✭✭
    Answer ✓

    Hey @LakeWaconia

    You're missing closed parenthesis for some of your WORKDAY and OR statements. One easy way to check these things is to just cycle though the end parenthesis and make sure they are reference the IF false statements.

    =IF([Outsource Due Date]@row = "", IF([Route Number]@row = "FAB-WELD-NOFIN-09", WORKDAY([Assembly Start Date]@row, -4), IF(OR([Route Number]@row = "FAB-FIN-01", [Route Number]@row = "FAB-FIN-07", [Route Number]@row = "FAB-WELD-FIN-01"), WORKDAY([Collect for OS Finish Due Date]@row, -2), IF(OR([Route Number]@row = "FAB-WELD-FIN-03", [Route Number]@row = "FAB-WELD-FIN-11", [Route Number]@row = "FAB-WELD-FIN-ASSY-03", [Route Number]@row = "FAB-WELD-FIN-ASSY-11"), WORKDAY([Collect for OS Finish Due Date]@row, -2), IF(OR([Route Number]@row = "FAB-WELD-FIN-04", [Route Number]@row = "FAB-WELD-FIN-08", [Route Number]@row = "FAB-WELD-FAB-FIN-06", [Route Number]@row = "FAB-WELD-FAB-FIN-05", [Route Number]@row = "FAB-WELD-FAB-FIN-19", [Route Number]@row = "FAB-WELD-FAB-FIN-20", [Route Number]@row = "FAB-WELD-FIN-ASSY-04", [Route Number]@row = "FAB-WELD-FIN-ASSY-08"), WORKDAY([Collect for OS Finish Due Date]@row, -3), IF(OR([Route Number]@row = "FAB-WELD-FIN-05", [Route Number]@row = "FAB-WELD-FIN-09", [Route Number]@row = "FAB-WELD-FAB-FIN-07", [Route Number]@row = "FAB-WELD-FAB-FIN-08", [Route Number]@row = "FAB-WELD-FAB-FIN-15", [Route Number]@row = "FAB-WELD-FAB-FIN-16", [Route Number]@row = "FAB-WELD-FIN-ASSY-05", [Route Number]@row = "FAB-WELD-FIN-ASSY-09"), WORKDAY([Collect for OS Finish Due Date]@row, -4), IF(OR([Route Number]@row = "FAB-WELD-FAB-FIN-09", [Route Number]@row = "FAB-WELD-FAB-FIN-10", [Route Number]@row = "FAB-WELD-FAB-FIN-17", [Route Number]@row = "FAB-WELD-FAB-FIN-18"), WORKDAY([Collect for OS Finish Due Date]@row, -5), IF(OR([Route Number]@row = "FAB-NOFIN-01", [Route Number]@row = "FAB-NOFIN-07"), WORKDAY([Assembly Start Date]@row, -1), IF(OR([Route Number]@row = "FAB-WELD-NOFIN-03", [Route Number]@row = "FAB-WELD-NOFIN-11"), WORKDAY([Assembly Start Date]@row, -2), IF(OR([Route Number]@row = "FAB-WELD-NOFIN-04", [Route Number]@row = "FAB-WELD-NOFIN-05", [Route Number]@row = "FAB-WELD-NOFIN-08"), WORKDAY([Assembly Start Date]@row, -3), ""))))))))), "OUTSOURCED")
    


  • LakeWaconia
    LakeWaconia ✭✭✭✭

    Thank you Devin! Your insights on the parenthesis helped me fix my formula. Posted here as comparison for anyone's future reference.

    =IF([Outsource Due Date]@row = "", IF([Route Number]@row = "FAB-WELD-NOFIN-09", WORKDAY([Assembly Start Date]@row, -4), IF(OR([Route Number]@row = "FAB-FIN-01", [Route Number]@row = "FAB-FIN-07", [Route Number]@row = "FAB-WELD-FIN-01"), WORKDAY([Collect for OS Finish Due Date]@row, -2), IF(OR([Route Number]@row = "FAB-WELD-FIN-03", [Route Number]@row = "FAB-WELD-FIN-11", [Route Number]@row = "FAB-WELD-FIN-ASSY-03", [Route Number]@row = "FAB-WELD-FIN-ASSY-11"), WORKDAY([Collect for OS Finish Due Date]@row, -2), IF(OR([Route Number]@row = "FAB-WELD-FIN-04", [Route Number]@row = "FAB-WELD-FIN-08", [Route Number]@row = "FAB-WELD-FAB-FIN-06", [Route Number]@row = "FAB-WELD-FAB-FIN-05", [Route Number]@row = "FAB-WELD-FAB-FIN-19", [Route Number]@row = "FAB-WELD-FAB-FIN-20", [Route Number]@row = "FAB-WELD-FIN-ASSY-04", [Route Number]@row = "FAB-WELD-FIN-ASSY-08"), WORKDAY([Collect for OS Finish Due Date]@row, -3), IF(OR([Route Number]@row = "FAB-WELD-FIN-05", [Route Number]@row = "FAB-WELD-FIN-09", [Route Number]@row = "FAB-WELD-FAB-FIN-07", [Route Number]@row = "FAB-WELD-FAB-FIN-08", [Route Number]@row = "FAB-WELD-FAB-FIN-15", [Route Number]@row = "FAB-WELD-FAB-FIN-16", [Route Number]@row = "FAB-WELD-FIN-ASSY-05", [Route Number]@row = "FAB-WELD-FIN-ASSY-09"), WORKDAY([Collect for OS Finish Due Date]@row, -4), IF(OR([Route Number]@row = "FAB-WELD-FAB-FIN-09", [Route Number]@row = "FAB-WELD-FAB-FIN-10", [Route Number]@row = "FAB-WELD-FAB-FIN-17", [Route Number]@row = "FAB-WELD-FAB-FIN-18"), WORKDAY([Collect for OS Finish Due Date]@row, -5), IF(OR([Route Number]@row = "FAB-NOFIN-01", [Route Number]@row = "FAB-NOFIN-07"), WORKDAY([Assembly Start Date]@row, -1), IF(OR([Route Number]@row = "FAB-WELD-NOFIN-03", [Route Number]@row = "FAB-WELD-NOFIN-11"), WORKDAY([Assembly Start Date]@row, -2), IF(OR([Route Number]@row = "FAB-WELD-NOFIN-04", [Route Number]@row = "FAB-WELD-NOFIN-05", [Route Number]@row = "FAB-WELD-NOFIN-08"), WORKDAY([Assembly Start Date]@row, -3), ""))))))))), "OUTSOURCED")

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!