Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Use the IF Function in Excel

The IF function in Excel checks for a true or false condition. Follow the main steps and troubleshooting guidance.

Table of Contents

Understanding Excel requires more than a headline. The overview below breaks down the key facts, changes, and user impact.

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 = 10 B = 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.

Excel IF Function Example

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

How to Use the IF Function in Excel – Excel IF Function Example

- 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

How to Use the IF Function in Excel – Excel IF Function Example (2)

- From the Insert Function dialog box, select the IF function and click OK. The Function Argumens dialog box is displayed

How to Use the IF Function in Excel – Excel IF Function Example (3)

- 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 Excel

FAQ

How does Excel work?

Understanding Excel requires more than a headline.

What should you prepare before using this method?

The overview below breaks down the key facts, changes, and user impact.

What should you do if the process does not work as expected?

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.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.