Quarter formula with some exceptions
Hi Everyone,
What I am trying to do is create a formula that looks at two things, the status column to check if the status is not started or draft. If it is either it needs to return a blank. If it is anything else, it needs to check the End Date column and determine what quarter it is and return the appropriate value Q1, Q2, Q3, Q4
=IFERROR(IF(OR(STATUS@row = "Not Started", STATUS@row = "Draft"), "", IF(OR(MONTH([End Date]@row) = 1, MONTH([End Date]@row) = 2, MONTH([End Date]@row) = 3), "Q1")), "")
it works for Q1,
=IFERROR(IF(OR(STATUS@row = "Not Started", STATUS@row = "Draft"), "", IF(OR(MONTH([End Date]@row) = 1, MONTH([End Date]@row) = 2, MONTH([End Date]@row) = 3), "Q1"), IF(OR(MONTH([End Date]@row) = 4, MONTH([End Date]@row) = 5, MONTH([End Date]@row) = 6), "Q2")), "")
When I start adding other Quarters, it returns #incorrect argument set. I'm super new to Smartsheets so I'd appreciate it if someone could show me where I went wrong.
Thanks!
-Chris
Best Answer
-
There was one closing paragraph that was out of place.
You shouldn't close any IF statements till the very end. In your example, you have a closing paragraph after "Q1" which ends the IF statement. Try this one:
=IFERROR(IF(OR(STATUS@row = "Not Started", STATUS@row = "Draft"), "", IF(OR(MONTH([End Date]@row) = 1, MONTH([End Date]@row) = 2, MONTH([End Date]@row) = 3), "Q1", IF(OR(MONTH([End Date]@row) = 4, MONTH([End Date]@row) = 5, MONTH([End Date]@row) = 6), "Q2"))), "")
Let me know how it goes.
Answers
-
There was one closing paragraph that was out of place.
You shouldn't close any IF statements till the very end. In your example, you have a closing paragraph after "Q1" which ends the IF statement. Try this one:
=IFERROR(IF(OR(STATUS@row = "Not Started", STATUS@row = "Draft"), "", IF(OR(MONTH([End Date]@row) = 1, MONTH([End Date]@row) = 2, MONTH([End Date]@row) = 3), "Q1", IF(OR(MONTH([End Date]@row) = 4, MONTH([End Date]@row) = 5, MONTH([End Date]@row) = 6), "Q2"))), "")
Let me know how it goes.
-
Thanks Mike, that was it!! i'm still struggling with simple syntax.
-
With nested IF statements you need to close all of the statements at the end.
=IF(condition, result, IF(condition, result, IF(condition, result, IF(condition, result, final else))))
Four open IF's and 4 closed at the end.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 423 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!