Home >Software Tutorial >Office Software >How to use the iif function in excel
php editor Yuzai introduces to you the usage of iif function in excel. The iif function is one of the logical functions in Excel and is used to return different values based on specified conditions. Through the iif function, you can determine whether the result is true or false based on conditions, and return the corresponding result value. This function is very practical when dealing with complex logical judgments, and can help simplify the writing of formulas and improve work efficiency. Next, let’s take a deeper look at the detailed usage and sample applications of the iif function!
There are iif functions in SQL statements and VBA codes in Excel. The iif function is similar to the IF function in the excel worksheet. It performs true and false value judgment and returns different results based on the logically calculated true and false values. IF function usage is (condition, yes, no). IF statement and IIF function in VBA, the former IF statement is a control statement that can execute different statements according to conditions, and the latter IIF function is a function that returns a specific value.
1. The three parameters required in the iif function:
iif function is
iif(condition,true result,false result)
The meaning of the three parameters:
condition represents the expression to be judged
true result represents the return result of the iif function when condition is true
false result represents the return result of the iif function when the condition is false
2. Excel iif usage example:
The following demonstrates the usage of the iif function,
rs=iif( a>985, "985 school", "non-985 school")
The above iif function statement,
Judge whether a is greater than 985
If a is greater than 985, rs The value is a 985 school
Otherwise the value of rs is a non-985 school
Special attention needs to be paid,
There must be a variable or cell to receive the return value of iif,
Otherwise, an error will be reported as missing:=
The following is to use the iif function in combination with cells
[c2]=IIf([b2] >985, "985 school", "non-985 school")
means that if the value in cell [b2],
is greater than 985,
will be Write 985 schools to cell [c2]
Otherwise, write non-985 schools to cell [c2]
The above is the detailed content of How to use the iif function in excel. For more information, please follow other related articles on the PHP Chinese website!