To use this function, choose Calc > Calculator.

Chooses which of two values to return based on whether a condition is true or false.

Syntax

IF(test,value_if_true,[value_if_false])

For test, specify the condition, and for value_if_true, specify the value to return if the condition is true. Conditions can be any numerical or logical expressions. The third argument, value_if_false, is optional and lets you specify a value to return if the condition is false. If you don't specify value_if_false, Minitab returns a missing value.

Example

To change a column of 0's and 1's to "male" and "female", enter the expression IF(C1=1,"male","female") and store the results in C2.

C1 C2-T
   
0 female
1 male
0 female
1 male
0 female
By using this site you agree to the use of cookies for analytics and personalized content.  Read our policy