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.

If Statements and Calculations

Jennifer Levey
edited 12/09/19 in Archived 2017 Posts

I'm trying to calculate a cost based on whether a field is marked (and another field that contains quantity) or not. So, if field A is marked (checkbox), then multiply $5 x Field B. If field A is not marked, then multiply $4 x Field B.

 

Is there a formula for this? Thank you, Jennifer

Tags:

Comments

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭
    edited 03/07/17

    Jennifer,

     

    =IF(  [field A]23  , 5 * [Field B]23  , 4 * [Field B]23 ) 

     

    for row 23

     

    This also works:

     

    =IF(  [field A]23  , 5 , 4  ) * [Field B]23

     

    I added spaces for clarity (I hope).

     

    Craig

     

  • Charles DESCOTES
    edited 03/08/17

    Beside,

    You may want to split Craig's formula to SHOW which figure is used:

    Create a new column with =IF(  [field A]23  , 5 , 4  )

    And in another column calculate your cost =([new column]23 * [Field B]23)

     

    Also, considering that the figures 5 and 4 could change over time, they can be located in a place where you can track or change them.

    In such case you simply refer to the related box in the formula.

This discussion has been closed.