Can I add another condition to a formula?
Hi,
I have a column that I am using a formula to return the Quarter based on a date. The date column doesn't always contain a date though. Sometimes it contains text. Can I add something to the formula to return NA if the content is "Evergreen" and return the Quarter if it's a date?
Here is the formula I am using:
=IF(MONTH([Request RenewalDate]@row)< 4, "Q1", IF(MONTH([RequestRenewal Date]@row)< 7, Q2", IF(MONTH([RequestRenewal Date]@row)< 10, "Q3", "Q4")))
Thanks ahead of time!!
Best Answers
-
Did you copy the formula out of the column to paste here? [Request Renewal Date] appears with spaces in different places. There is also a quotation mark missing from before Q2.
=IF([Request Renewal Date]@row = "Evergreen", "NA", IF(MONTH([Request Renewal Date]@row) < 4, "Q1", IF(MONTH([Request Renewal Date]@row) < 7, "Q2", IF(MONTH([Request Renewal Date]@row) < 10, "Q3", "Q4"))))
-
Happy to help. 👍️
Check out these two resources:
Answers
-
You could wrap the whole thing in an IFERROR.
=IFERROR(original_formula, "N/A")
-
Did you copy the formula out of the column to paste here? [Request Renewal Date] appears with spaces in different places. There is also a quotation mark missing from before Q2.
=IF([Request Renewal Date]@row = "Evergreen", "NA", IF(MONTH([Request Renewal Date]@row) < 4, "Q1", IF(MONTH([Request Renewal Date]@row) < 7, "Q2", IF(MONTH([Request Renewal Date]@row) < 10, "Q3", "Q4"))))
-
@Carson Penticuff I noticed that too, but I don't think it was copied directly from the sheet. If it was, it would have produced a different error, and I also notice the lack of a space before the "<".
-
Thanks, it works now. I thought I had copied it from the sheet, but I must have copied it from my formula cheat sheet because the errors you found were OK on the sheet. That's not the important part though. I was not counting the parentheses correctly, which is what fixed the issue. Thank you both!
Does anyone have a recommendation for where to find basic syntax rules? I'm not finding them and I think that would really help me get more proficient with formulas. Understanding the rules behind parens would especially help. 🤔
-
Happy to help. 👍️
Check out these two resources:
-
@Paul Newcome Thank you for these. I will did in!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.1K Get Help
- 348 Global Discussions
- 199 Industry Talk
- 427 Announcements
- 4.4K Ideas & Feature Requests
- 133 Brandfolder
- 127 Just for fun
- 127 Community Job Board
- 455 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 282 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!