If not blank formula for 2 column options + result as a sum formula or 0

Hello,

I am trying to make a formula where if "Drug Selected/ Wrong drug (0)" is not blank or "Patient profile / wrong patient (0)" is not blank then the return value is 0 and if it is blank then there is a formula where it adds up the value remaining columns.

Would anyone be able to help me with making this formula?

Thank you for your help in advance

Answers

  • Adam Murphy
    Adam Murphy ✭✭✭✭✭✭

    Try something like this: =IF(AND(NOT(ISBLANK([Drug Selected/ Wrong drug (0)]@row)), NOT(ISBLANK([Patient profile / wrong patient (0)]@row))), 0, SUM(the other fields you want to add up)) Hope that helps.

  • Michelle.ch
    edited 09/11/24

    Thank you, I tried the formula however the return value is not 0 when the "Drug Selected/ Wrong drug (0)" column and or "Patient profile / wrong patient (0)" column are not blank. I still get the sum value of all the other columns instead. If either of these columns have any number then the result of the formula should result in a zero or the sum of the all the other columns.

    Edit: the formula below worked, had to use OR instead of AND

    =IF(OR(NOT(ISBLANK([Drug Selected/ Wrong drug (0)]2)), NOT(ISBLANK([Patient profile / wrong patient (0)]2))), 0, SUM(prescriber2+
    sig2+[dispense quantity]2+repeats2+[days supply]2+[Hard copy documentation]2+[Billing Procedure]2+[Auxiliary Labels]2+Questions2+[Evaluation (total out of 5)]2))

    Thank you for your help in advance!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!