Syntax resolution for IF/AND/CONTAINS

Please help with syntax error.
I'm trying to check a box if the following is true (in english):
IF TEXT is not in Project Long Name column AND Over 90 has content
OR
IF TEXT is in the Project Long Name column AND Over 180 has content
=IF([Over 90]@row <> “”, AND(NOT(CONTAINS("TEXT", [Project Long Name]@row))), OR([Over 180]@row <> “”, AND(CONTAINS(“TEXT”, [Project Long Name]))), 1, 0)
Best Answer
-
@jjesmith, try this...
=IF(OR(AND(NOT(CONTAINS("TEXT", [Project Long Name]@row)), [Over 90]@row <> ""), AND(CONTAINS("TEXT", [Project Long Name]@row), [Over 180]@row <> "")), 1, 0)
You were correct to use OR() and HAS().
Check the box when either case1 or case2 is true, i.e., OR(case1, case2) = true. Expressed as...
IF(OR(case1, case2), 1, 0)
case1 = AND(NOT(CONTAINS("TEXT",[Project Long Name]@row)), [Over 90]@row <> "")
case2 = AND(CONTAINS("TEXT",[Project Long Name]@row), [Over 180]@row <> "")
You may want to use HAS() if you're looking for the whole word. Your CONTAINS() expression will evaluate to true if "text" appears anywhere in the field. E.g., "Context", "Textile"
Answers
-
@jjesmith, try this...
=IF(OR(AND(NOT(CONTAINS("TEXT", [Project Long Name]@row)), [Over 90]@row <> ""), AND(CONTAINS("TEXT", [Project Long Name]@row), [Over 180]@row <> "")), 1, 0)
You were correct to use OR() and HAS().
Check the box when either case1 or case2 is true, i.e., OR(case1, case2) = true. Expressed as...
IF(OR(case1, case2), 1, 0)
case1 = AND(NOT(CONTAINS("TEXT",[Project Long Name]@row)), [Over 90]@row <> "")
case2 = AND(CONTAINS("TEXT",[Project Long Name]@row), [Over 180]@row <> "")
You may want to use HAS() if you're looking for the whole word. Your CONTAINS() expression will evaluate to true if "text" appears anywhere in the field. E.g., "Context", "Textile"
-
Worked perfectly. Thank you!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 66.7K Get Help
- 438 Global Discussions
- 152 Industry Talk
- 497 Announcements
- 5.3K Ideas & Feature Requests
- 85 Brandfolder
- 155 Just for fun
- 77 Community Job Board
- 509 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 307 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!