If then formula

Options

How do I set up a formula so that if([column A]@row="something", copy the value in [Column B]@row to [Column C]@row,""). I appreciate any help you can offer.

Tags:

Answers

  • KPH
    KPH ✭✭✭✭✭✭
    Options

    Hi @LinMyers

    You could put a formula like this in Column C

    =IF([column A]@row="something",[column B]@row)

    This will return the value in column B only if the value in Column A is "something". If the value in Column A is not "something", then column C will be blank.

    It won't be a strict "copy" but a reference - whatever is displayed in Column C will change if Column B changes, and will vanish if Column A no longer equals "something".

    Does that help?

  • LinMyers
    Options

    Thank you for your response. Of course I left out critical information. Column C is a dropdown list because when Column A is not a specific value, I can manually select the appropriate value from the dropdown in Column C.

  • KPH
    KPH ✭✭✭✭✭✭
    Options

    That should be fine @LinMyers

    You can put your formula in the cell even if it is a dropdown (and if it is restricted and you are admin you can "OK" the error message). It will return nothing if Column A does not equal something and when it does it will return whatever is in Column B.

    As soon as you select anything manually, you will overwrite the formula. Will that be a problem?

  • LinMyers
    Options

    Sadly, that doesn't work. Once I add the formula to Column C (which works), I lose the ability to select from the dropdown, even though the column type is still a dropdown.

  • KPH
    KPH ✭✭✭✭✭✭
    Options

    Did you make the formula a column formula? You should be able to select from the drop down if it is a cell formula.

  • LinMyers
    Options

    Yes, it is a column formula and the field type is still a dropdown.

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Options

    If you want an automatic selection made as well as the ability to use manual selection, you will need to set up a Change Cell automation instead of using a formula.

  • KPH
    KPH ✭✭✭✭✭✭
    Options

    Hi @LinMyers

    If you use a column formula in any situation (not just a drop downs), you are not able to also manually edit the cell. If you want to use a formula to populate column C , then your options are:

    1. Use a cell formula in column C rather than a column formula
    2. Put your manual drop down in a different column (say column D) and use a column formula in column C to return the value from column B if A is "something" and the value from column D, if it is not. That formula would be:

    =IF([column A]@row="something",[column B]@row,[column D]@row)

    Your third option, like Paul says, is to use an automation instead of a formula. You can find more information on automations here:


Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!