Welcome to the Smartsheet Forum Archives


The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, please Visit the Current Forums.

Two criterias in one formula IF(COUNTIFS(

Hello community!

 

I need help with this formula : =IF(COUNTIFS(Barcode:Barcode, "Left Triple Track") > 0, (Stock3) - 6)

 

This works perfectly but  I need to add "Right Triple Track" into the same formula for entire column Barcode:Barcode

 

I tried =IF(COUNTIFS(Barcode:Barcode, "Left Triple Track") > 0, (Stock3) - 6),(Barcode:Barcode, "Right Triple Track") > 0, (Stock3) -6 but it didn't work.

Comments

  • John Sauber
    John Sauber ✭✭✭✭✭✭

    Perhaps a cleaner version of the formula you're attempting would be:

     

    =IF(OR(COUNTIFS(Barcode:Barcode, "Left Triple Track") > 0, COUNTIFS(Barcode:Barcode, "Right Triple Track") > 0), (Stock3) - 6)

     

    I just OR'd the two statements which you want to yeild the result (Stock3-6). You do not require the parentesis around (Stock3-6), by the way. The less characters in your formula, the better.

     

    To nest it like you're doing, you just have the syntax wrong. Here is what you're looking for in that case:

     

    =IF(COUNTIFS(Barcode:Barcode, "Left Triple Track") > 0, Stock3 - 6, IF(COUNTIFS(Barcode:Barcode, "Right Triple Track") > 0, Stock3 - 6))

This discussion has been closed.