Want to create more than one IF statement
Hi! I don't know whats wrong with this formula, it's giving "Incorrect argument".
=IF(OR(Month@row = "10"; Month@row = "11"; Month@row = "12"); IF(AND([Return date]@row = YEAR(TODAY()); "Q4")))
I want to say: If month equals to 10, 11 or 12 (I created a month column), and if the year equals to the year today, then put Q1 on the cell. This is actually trying to separate the year in quarters, so I'll have to do this for every month of the year, months 1,2,3 = Q1; 4,5,6 = Q2; 7,8,9 = Q3.
Answers
-
Try separating each argument within OR() and AND() with a comma instead of a semicolon. The same for each argument within the IF().
-
Hi @browning.m,
The incorrect argument is caused by how your formula is composed, so this should assist!
You can skip the Month column if you are taking the month from the return date:
=IF(AND(OR(MONTH([Return Date]@row) = 1, MONTH([Return Date]@row) = 2, MONTH([Return Date]@row) = 3), YEAR([Return Date]@row) = YEAR(TODAY())), "Q1", IF(AND(OR(MONTH([Return Date]@row) = 4, MONTH([Return Date]@row) = 5, MONTH([Return Date]@row) = 6), YEAR([Return Date]@row) = YEAR(TODAY())), "Q2", IF(AND(OR(MONTH([Return Date]@row) = 7, MONTH([Return Date]@row) = 8, MONTH([Return Date]@row) = 9), YEAR([Return Date]@row) = YEAR(TODAY())), "Q3", IF(AND(OR(MONTH([Return Date]@row) = 10, MONTH([Return Date]@row) = 11, MONTH([Return Date]@row) = 12), YEAR([Return Date]@row) = YEAR(TODAY())), "Q4"))))
This would give you the following result:
You've not specified what you'd like to happen to dates falling outside of this year, so I haven't been able to include that in the formula. If you have something in particular I can hopefully help with that.
Hopefully this helps, if you've any questions etc. then just post! 😊
-
@Nick Korna Thank you!!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63K Get Help
- 380 Global Discussions
- 212 Industry Talk
- 442 Announcements
- 4.6K Ideas & Feature Requests
- 140 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 450 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 289 Events
- 34 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!