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
- Customer Resources
- 64.8K Get Help
- 434 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!