If formula: activity code if a certain word is found
I have a formula that puts a activity code if a certain word is found in the narrative. However, it only place one word. In the example below the word "telephone" should have put CONFERNCE CALL and "draft" should have put DRAFT, however only DRAFT showed up.
Below is my formula:
=IF(CONTAINS("review", Narrative@row), "REVIEW", IF(CONTAINS("email", Narrative@row), "EMAIL", IF(CONTAINS("draft/revise", Narrative@row), "DRAFT/REVISE", IF(CONTAINS("revise", Narrative@row), "REVISE", IF(CONTAINS("draft", Narrative@row), "Draft", IF(CONTAINS("Research", Narrative@row), "RESEARCH", IF(CONTAINS("analyze", Narrative@row), "ANALYZE",IF(CONTAINS("TELEPHONE", Narrative@row), "CONFERENCE CALL",IF(CONTAINS("OUTLINE", Narrative@row), "OUTLINE", "")))
Answers
-
-
Hi @kari1282
IF formulas are a unique type of formula. When firing the IF formula tests EACH IF statement until it finds the First TRUE condiiton, then it fires its THEN statement and stops working through the list. Because DRAFT fired first in the formula set up, it added DRAFT and then stopped checking.
One way this might work for you is to do something a little different, maybe make a column for each type of activity you need which searches the text as you do in your if statement but each column would only search for its type, and then posts the word like draft, telephone, etc. Then, you can use the JOIN formula in the Activity 2 column to join all of those other columns together providing you your expected result.
Would that work for you?
-
Thank you, is there a way I can modify the current formula to get it show to answers. The spreadsheet in question already has a lot of columns and I would prefer not to add more or have to create and extra sheet just for this.
Thanks,
Karrie
-
Hi @kari1282
To add to Mike's excellent answer.
Try something like this.
=IF(CONTAINS("review", Narrative@row), "REVIEW" + CHAR(10), "") + IF(CONTAINS("email", Narrative@row), "EMAIL" + CHAR(10), "") + IF(CONTAINS("draft/revise", Narrative@row), "DRAFT/REVISE" + CHAR(10), "") + IF(CONTAINS("revise", Narrative@row), "REVISE" + CHAR(10), "") + IF(CONTAINS("draft", Narrative@row), "Draft" + CHAR(10), "") + IF(CONTAINS("Research", Narrative@row), "RESEARCH" + CHAR(10), "") + IF(CONTAINS("analyze", Narrative@row), "ANALYZE" + CHAR(10), "") + IF(CONTAINS("TELEPHONE", Narrative@row), "CONFERENCE CALL" + CHAR(10), "") + IF(CONTAINS("OUTLINE", Narrative@row), "OUTLINE" + CHAR(10), "")
Did that work?
I hope that helps!
Be safe and have a fantastic week!
Best,
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
✅Did my post(s) help or answer your question or solve your problem? Please help the Community by marking it as the accepted answer/helpful. It will make it easier for others to find a solution or help to answer!
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
-
To add.
This is how it will look. All values that are true will be on a separate line in the cell.
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
-
@Andrée Starå That is a REALLY cool solution. I have never considered adding IF statements together with soft returns. That is a winner for sure. REALLY great solution!!! One I am bookmarking and referencing for the future. VERY COOL. +10 -- MIND BLOWN...
-
Thanks so much for all the kind words!
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå | Workflow Consultant / CEO @ WORK BOLD
W: www.workbold.com | E:andree@workbold.com | P: +46 (0) - 72 - 510 99 35
Feel free to contact me for help with Smartsheet, integrations, general workflow advice, or anything else.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!