if / or / contains
Hello, I need some help with a formula using if / or / contains.
If the cell contains "card", return the words "Business Card", or if the cell contains "page, return the words "1/4 Page", otherwise keep blank.
I can get part way there: =IF(CONTAINS("business", [Spring / Summer Newsletter Ad Size]@row), "Business Card", "") I just can't the rest of it to work.
Thanks.
Best Answer
-
Hi Chevon,
Maybe this formula can help:
=IF(CONTAINS("card", [Spring / Summer Newsletter Ad Size]@row), "Business Card", IF(CONTAINS("page", [Spring / Summer Newsletter Ad Size]@row), "1/4 Page", ""))
I did some testing:
The part that is purple contains the formula.
The formula is made out of a nested IF, it is an IF inside an IF.
For example:
=IF(put condition here, when true this happens, when false this happens)
In the true and false section you can keep adding another if.
=IF(put condition here, when first if is true then IF(put condition here, when true this happens, when false this happens), when first if is false this happens or you can put another if here)
Hope it helps,
Sam
Answers
-
Hi Chevon,
Maybe this formula can help:
=IF(CONTAINS("card", [Spring / Summer Newsletter Ad Size]@row), "Business Card", IF(CONTAINS("page", [Spring / Summer Newsletter Ad Size]@row), "1/4 Page", ""))
I did some testing:
The part that is purple contains the formula.
The formula is made out of a nested IF, it is an IF inside an IF.
For example:
=IF(put condition here, when true this happens, when false this happens)
In the true and false section you can keep adding another if.
=IF(put condition here, when first if is true then IF(put condition here, when true this happens, when false this happens), when first if is false this happens or you can put another if here)
Hope it helps,
Sam
-
Hi, @Chevon Brownell ,
When using IF with CONTAINS, they tend to work better as a Nested IF instead of as an OR function. Try this:
=IF(CONTAINS("card", test@row), "Business Card", IF(CONTAINS("page", test@row), "1/4 Page"))
where "test" is the name of the column you are referencing.
Let me know if this helps solve your problem.
-
Thanks Sam. Your formula worked!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.3K Get Help
- 364 Global Discussions
- 199 Industry Talk
- 428 Announcements
- 4.4K Ideas & Feature Requests
- 136 Brandfolder
- 127 Just for fun
- 128 Community Job Board
- 445 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 283 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!