How to use the IF function in Excel
The IF function in Excel checks for a true or false condition. If the condition is true, the function returns a value, if the condition fails the function returns another value
The IF function in Excel checks for a true or false condition. If the condition is true, the function returns a value, if the condition fails the function returns another value
The function usually has 3 arguments: the condition you want to check, the return value if the condition is true, and the value returned if the condition is false
The syntax of the IF function in Excel
IF (Test condition, value if condition is true, value if condition is wrong)
Test conditions
The test condition evaluates an expression to see whether it is TRUE (true) or FALSE (false).
Operator used to test
Value to check
Result
A = 10B = 5 C = 15
D = 10
= (Degree)
A = B
FALSE (False)
A = D
TRUE (Right)
> (Larger)
A> B
TRUE (Right)
A> C
FALSE (False)
<(Smaller)
A
FALSE (False)
A TRUE (Right) > = (Greater than or equal to) A> = B TRUE (Right) A> = D TRUE (Right) A> = C FALSE (False) <= (Less than or equal to) A <= B FALSE (False) A <= C TRUE (Right) A <= D TRUE (Right) True condition value The correct IF condition returns a value or operation. Whether it is a value or an operation, the result is returned in the cell containing the IF () function. Incorrect condition value The wrong IF condition will return a value or an operation and the result returned in the cell containing the IF () function. To understand Excel's IF function, follow the following example Follow the example of calculating bonuses based on all sales. A company pays salespeople 5% of the bonus if the price of the total sales is less than $ 5,000 per month, but if the price is over $ 5,000 per month, pay that employee 10% bonus. Write IF () function: IF (Total sales> 5000, Total sales * 10%, Total sales * 5%) - Enter the following data for columns A and B - Type the IF () function into a cell. In this case, select cell C2 - From the Insert menu, click Function . , Insert Function dialog box is displayed Or press the shortcut key combination Shift + F3 - From the Insert Function dialog box, select the IF function and click OK. The Function Argumens dialog box is displayed - In Logical_test , enter B2> 5000 . Press Tab - In Value_if_true , enter 10% . Press Tab - In Value_if_false section, enter 5% . Click OK . - The cells C3 to C6 are executed like cell C2 Note : Any time you change data from column B2 to B6, the bonus portion of the employee is automatically calculated. See also: How to use Vlookup function in ExcelExcel IF function example
You should read it
- How to use Hlookup function on Excel
- Basic Excel functions that anyone must know
- How to use the SUM function to calculate totals in Excel
- How to use the IFS function in Excel 2016
- Save time with these text formatting functions in Microsoft Excel
- How to use the LEN function in Excel
- How to use the SWITCH function in Excel 2016
- How to use the WRAPROWS function in Excel
- How to use the NPER function in Excel to plan loans and savings
- How to use COUNTIF function on Excel
- How to use the MOD function and QUOTIENT function in Excel
- How to use MID functions to get strings in Excel
Maybe you are interested
How to turn off Update Link notification in Excel - File content from many different sources Create Autotext in Word 2007, edit documents faster Alignment in Word 2010, beautiful alignment of Word 2010 documents How to master numerical data in Google Sheets with the AVERAGE function Excel 2016 - Lesson 8: How to format numbers in Excel (Number Formats) How to change commas to dots in Word - Number unit separator