2.87 FAQ-871 Does Origin have a "IF" function?

Last Update: 12/6/2018

Yes, we added if() function since Origin 2019.

E.g. Suppose column A contains values with some missing values. Enter if(A=1/0, mean(A), A) in column B's F(X) cell, B will be filled with column A values if there is value in A; column B will be filled with mean of column A if the corresponding row in A is missing values or blank.

If function.jpg

Before Origin 2019, please use "?" operator.

To do the same calculation above, enter A=1/0? Mean(A):A in column B's F(x) cell

A more complicated example: I have a series of row numbers in column A and want to fill column B with conditional sequences so that if the value in col(A) is

  • 1<=col(A)[i]<=7, then col(B)[i] is filled with "Low"
  • 7<col(A)[i]<=17, then col(B)[i] is filled with"Mid"
  • 17<col(A)[i], then col(B)[i] is filled with"High"

Enter A>=1&&A<=7?"Low":(A>7&&A<=17?"Mid":"High") in column B's F(x) cell

See also Excel and Origin Functions Comparison


Keywords:IF function, set values under condition, conditional operator