I am new to SharePoint.

I am looking for a way to assign a value for a column depending on another column's value. For example, the choice column dictates "New York" the value of the calculated column would display "Person1," and there are also more choices like "Florida" and the column should write "Person2".

What is the exact formula for this?

Thanks!

有帮助吗?

解决方案

Try using below formula:

=IF([ChoiceField]="New York","Person1",IF([ChoiceField]="Florida","Person2",[ChoiceField]))

This formula is similar to:

if(ChoiceField === "New York") {
    CalculatedValue = "Person1";
} else if(ChoiceField === "Florida") {
    CalculatedValue = "Person2";
} else {
    CalculatedValue = ChoiceField;
}

IF Function:

Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE. Use IF to conduct conditional tests on values and formulas.

Syntax:

IF(logical_test,value_if_true,value_if_false)

Remarks:

Up to seven IF functions can be nested as value_if_true and value_if_false arguments to construct more elaborate tests.

Reference:

IF function.

许可以下: CC-BY-SA归因
scroll top