top of page

You are learning IF function in MS Excel

How do I write an IF statement to check if a cell is greater than another cell?

Here's how to write an IF statement to check if a cell is greater than another cell in Excel:

Syntax:

```excel
=IF(cell1 > cell2, "text/formula if true", "text/formula if false")
```

Explanation:

* `IF` initiates the conditional statement.
* `cell1 > cell2`: This is the logical test. It checks if the value in `cell1` is greater than the value in `cell2`. You can replace `>` with other comparison operators like `<` (less than), `>=` (greater than or equal to), etc.
* `"text/formula if true"`: This is the output displayed if the condition (`cell1 > cell2`) is true. You can enter text (e.g., "Over Budget") or another formula that will be calculated if the condition is met.
* `"text/formula if false"`: This is the output displayed if the condition (`cell1 > cell2`) is false. You can enter text (e.g., "Under Budget") or another formula to be used if the condition is not met.

Example:

```excel
=IF(A1 > B1, "Sales Exceeded Target", "Sales Below Target")
```

In this example, the formula checks if the value in cell A1 is greater than the value in cell B1. If it is, the text "Sales Exceeded Target" is displayed. Otherwise, "Sales Below Target" is displayed.

Tips:

* You can replace cell references with actual values if needed (e.g., `=IF(A1 > 100, "High Value", "Low Value")`).
* You can nest IF statements for more complex conditions.

By understanding this basic structure, you can create IF statements to compare various aspects of your data in Excel.

bottom of page