# Help with complicated formula

=IF(OR([Phase Start Date]@row > DATE(2023, 2, 28)), [Phase End Date]@row < DATE(2023, 2, 1), 0, IF(AND([Phase Start Date]@row <= DATE(2023, 2, 28), [Phase Start Date]@row >= DATE(2023, 2, 1)), (NETWORKDAYS([Phase Start Date]@row, DATE(2023, 2, 28)) / 5) * [Resources Needed Per Week]@row, IF(AND( [Phase End Date]@row>=DATE(2023, 2, 1),[Phase End Date]@row<=DATE(2023, 2, 28)), (NETWORKDAYS(DATE(2023, 2, 1),[Phase End Date]@row) / 5) * [Resources Needed Per Week]@row, (NETWORKDAYS(DATE(2023, 2, 1),DATE(2023, 2, 28)) / 5) * [Resources Needed Per Week]@row,)))

The formula above is meant to calculate resources per month with some stipulations on when the phase start and end dates are. It is coming out as #unparseable. Can anyone help me out with what may be causing this.

• ✭✭✭✭✭✭

=IF(OR([Phase Start Date]@row > DATE(2023, 2, 28), [Phase End Date]@row < DATE(2023, 2, 1)), 0, IF(AND([Phase Start Date]@row <= DATE(2023, 2, 28), [Phase Start Date]@row >= DATE(2023, 2, 1)), (NETWORKDAYS([Phase Start Date]@row, DATE(2023, 2, 28)) / 5) * [Resources Needed Per Week]@row, IF(AND([Phase End Date]@row>=DATE(2023, 2, 1),[Phase End Date]@row<=DATE(2023, 2, 28)), (NETWORKDAYS(DATE(2023, 2, 1),[Phase End Date]@row) / 5) * [Resources Needed Per Week]@row, (NETWORKDAYS(DATE(2023, 2, 1),DATE(2023, 2, 28)) / 5) * [Resources Needed Per Week]@row

• ✭✭✭✭✭✭

=IF(OR([Phase Start Date]@row > DATE(2023, 2, 28), [Phase End Date]@row < DATE(2023, 2, 1)), 0, IF(AND([Phase Start Date]@row <= DATE(2023, 2, 28), [Phase Start Date]@row >= DATE(2023, 2, 1)), (NETWORKDAYS([Phase Start Date]@row, DATE(2023, 2, 28)) / 5) * [Resources Needed Per Week]@row, IF(AND([Phase End Date]@row>=DATE(2023, 2, 1),[Phase End Date]@row<=DATE(2023, 2, 28)), (NETWORKDAYS(DATE(2023, 2, 1),[Phase End Date]@row) / 5) * [Resources Needed Per Week]@row, (NETWORKDAYS(DATE(2023, 2, 1),DATE(2023, 2, 28)) / 5) * [Resources Needed Per Week]@row

• Thank you @Mike TV. What was the issue? Was it the parenthesis at the end?

• ✭✭✭✭✭✭

You'd have to closely compare the two formulas but basically you have extra parenthesis in some places and other places you needed two parenthesis but only had one. Also at the very end you had a comma without anything but closing parenthesis after it which I think can cause an error.

I also wasn't sure how many closing parenthesis would be needed without carefully counting all the open and close parenthesis so I just left all of the closing parenthesis off at the end because SmartSheet will automatically fill those in for you if you leave them off. It's better than having one too many at the end which will cause the formula to fail.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!