How To Make A Condition In Excel

Table of contents:

How To Make A Condition In Excel
How To Make A Condition In Excel

Video: How To Make A Condition In Excel

Video: How To Make A Condition In Excel
Video: Excel Conditional Formating - Create your own rules - Complex Examples 2024, May
Anonim

In various programming languages, "conditional statements" are used to test a condition. The spreadsheet editor Microsoft Office Excel has its own set of functions, which can be called a very simplified programming language. In it, the analogue of the conditional operator is the "IF" function.

How to make a condition in Excel
How to make a condition in Excel

Necessary

Microsoft Office Excel spreadsheet editor

Instructions

Step 1

Select the cell in the spreadsheet where you want the condition check function to be placed and start the Formula Wizard. This can be done by clicking the icon located to the left of the formula bar. In the window that opens, open the "Category" drop-down list and select the "Logical" line. A list of functions will appear under this list - select the line “IF” in it, press the OK button and Excel will open a form for creating a function. The same form can be called in another way - in the "Libraries and Functions" group of commands on the "Formulas" tab, open the "Logical" drop-down list and select the "IF" item.

Step 2

In the "Log_expression" field, place the condition that this function should check. For example, if you need to check if the value in cell A1 is negative, start by clicking on this cell with the mouse or manually entering its address (A1). Then add a less than sign and a zero to get this entry: A1

Step 3

Go to the next form field - "Value_if_true". Place in it a number, a word, or the address of a cell in the table that this cell should display if the specified condition is met. A word or phrase must be entered in quotes, a number - without quotes, and the easiest way to set the cell address is by clicking on it with the mouse pointer. For the example from the previous step, you can put the text " value is negative " here.

Step 4

The next field of the form - "Value_if_true" - fill in exactly the same as the previous one, but put in it the value that should be displayed if the specified condition is not met. In the example used here, it is logical to place the inscription " value is not negative ".

Step 5

Click OK and Excel will immediately check the condition you specified and display the result. After completing the wizard, for the example used above, the formula in the cell should look like this: “= IF (A1

Recommended: