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
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!