If (general) function

To use this function, choose Calc > Calculator.

Chooses a value to return for each of multiple conditions evaluated sequentially.

Syntax

IF(test,value_if_true,...,test,value_if_true,[value_if_false])

For test, specify each condition. Conditions can be any numerical or logical expressions. For value_if_true, specify the value to return if the condition is true. You can enter multiple conditions and values. All values must be the same data type (numeric or text). Minitab returns the value corresponding to the first true condition, working from left to right. The final argument, value_if_false, is optional and lets you specify a value to return if all the conditions are false. If you don't specify value_if_false, Minitab returns a missing value.

Example

To convert the numbers 0-6 to ratings of "low", "medium" and "high", enter the expression IF(C1<=2,"low",C1<=4,"medium","high") and store the results in C2.

C1 C2-T
   
0 low
1 low
6 high
3 medium
2 low
By using this site you agree to the use of cookies for analytics and personalized content.  Read our policy