IF CONTAINS Formula to return different text values in second column
Hi! I am looking for some help in creating a formula where if a certain word is found in one column, another word is returned in a second column. For example if "Head", "Nasal", or "Spine" is contained in the Procedure column, "Neuro" is returned in the Clinical Specialty column.
I've tried different variations of this and none were working properly.
=IF(PROCEDURE@row, CONTAINS(" NASAL"), "Neuro")
Ultimately, I'd like to have a 5 or 6 different words in the Clinical Specialty column.
If "Head", "Nasal", or "Spine" in the Procedure column return "Neuro" in Clinical Specialty.
If "Chest" or "Cardiac" in Procedure column return "Cardiothoracic" in Clinical Specialty.
If "Extremity", "Forearm", "Ankle", "Foot" in Procedure column return "MSK" in Clinical Specialty.
Thank you!
Best Answer
-
See if this works for you.
=IF(OR(CONTAINS("Head", [PROCEDURE]@row), CONTAINS("Nasal", [PROCEDURE]@row), CONTAINS("Neuro", [PROCEDURE]@row)), "Neuro", IF(OR(CONTAINS("Chest", [PROCEDURE]@row), CONTAINS("Cardiac", [PROCEDURE]@row)), "Cardiothoracic", IF(OR(CONTAINS("Extremity", [PROCEDURE]@row), CONTAINS("Forearm", [PROCEDURE]@row), CONTAINS("Ankle", [PROCEDURE]@row), CONTAINS("Foot", [PROCEDURE]@row)), "MSK")))
Answers
-
See if this works for you.
=IF(OR(CONTAINS("Head", [PROCEDURE]@row), CONTAINS("Nasal", [PROCEDURE]@row), CONTAINS("Neuro", [PROCEDURE]@row)), "Neuro", IF(OR(CONTAINS("Chest", [PROCEDURE]@row), CONTAINS("Cardiac", [PROCEDURE]@row)), "Cardiothoracic", IF(OR(CONTAINS("Extremity", [PROCEDURE]@row), CONTAINS("Forearm", [PROCEDURE]@row), CONTAINS("Ankle", [PROCEDURE]@row), CONTAINS("Foot", [PROCEDURE]@row)), "MSK")))
-
This worked, thanks so much!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.1K Get Help
- 382 Global Discussions
- 212 Industry Talk
- 444 Announcements
- 4.6K Ideas & Feature Requests
- 140 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 451 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 291 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!