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!

Tags:

Best Answer

  • Carson Penticuff
    Carson Penticuff ✭✭✭✭✭✭
    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

  • Carson Penticuff
    Carson Penticuff ✭✭✭✭✭✭
    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")))

  • Rita
    Rita ✭✭

    This worked, thanks so much!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!