Formula Assistance

Hello,

I have a formula that works but need to add more variables to it. So when certain criteria are met then it produces a certain response. However, for the heart failure, I need to also include regular or bariatric scale, so I think i need to add and AND to the formula but cant figure it out.

=IF([CareKit Type Requested]@row = "Hypertension", "Blood Pressure Kit", IF([CareKit Type Requested]@row = "Heart Failure", "Heart Failure Kit w/Bariatric Scale", IF([CareKit Type Requested]@row = "Diabetes", "Blood Sugar Control Care Kit", IF([CareKit Type Requested]@row = "COPD", "COPD Kit"))))

Answers

  • =Chris Palmer
    =Chris Palmer ✭✭✭✭✭
    edited 04/29/24

    Hello @CaraBart28

    You can give this a shot for the AND:

    =IF([CareKit Type Requested]@row = "Hypertension", "Blood Pressure Kit",
    IF(AND([CareKit Type Requested]@row = "Heart Failure",
    [Kit Type Requested]@row = "Heart Failure Kit w/Bariatric Scale"),"Heart Failure Kit w/Bariatric Scale",
    IF([CareKit Type Requested]@row = "Diabetes", "Blood Sugar Control Care Kit",
    IF([CareKit Type Requested]@row = "COPD", "COPD Kit"))))

    Alternatively, if it's suitable for your requirements, you can use:
    IF(CONTAINS this will simply capture any mention of "Heart Failure" in [CareKit Type Requested]@row
    to say "Heart Failure"

    =IF(CONTAINS("Heart Failure", [CareKit Type Requested]@row), "Heart Failure",
    IF([CareKit Type Requested]@row = "Hypertension", "Blood Pressure Kit",
    IF([CareKit Type Requested]@row = "Diabetes", "Blood Sugar Control Care Kit",
    IF([CareKit Type Requested]@row = "COPD", "COPD Kit", ""))))

    Let me know if any of these options work for you : -)

  • CaraBart28
    CaraBart28 ✭✭✭✭

    The first one is not working. I am getting the same syntax error. So I need for it to either return Heart Failure Kit with Bariatric Scale if they choose heart failure and the helper column returns bariatric scale, or I need it to return heart failure kit with regular scale if the type is heart failure and the helper column is regular scale.

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!