## You are learning IF function in MS Excel

What's the difference between absolute and relative cell references in IF statements?

The main difference between absolute and relative cell references in IF statements lies in how their locations are interpreted when the formula is copied or applied to other cells.

* Absolute Cell References: Represented by a dollar sign ($) before the column letter and/or row number (e.g., $A$1, C$2). An absolute reference always refers to the specific cell location regardless of where the formula is copied.

* Relative Cell References: Don't include any dollar signs (e.g., A1, C2). A relative reference is based on the position of the cell containing the formula. When copied, the relative reference adjusts its offset based on the new location.

Here's how they work in IF statements:

Scenario: You have a table with product codes in column A and their corresponding prices in column B. You want to create an IF statement in cell C2 to display "Discounted" if the price is lower than $10 (in cell B1), otherwise display "Regular Price".

Using Absolute References:

```excel

=IF($B2<$B$1,"Discounted","Regular Price")

```

- In this case, `$B$1` is an absolute reference that always points to cell B1, regardless of where you copy the formula.

Using Relative References:

```excel

=IF(B2<B1,"Discounted","Regular Price")

```

- Here, `B2` and `B1` are relative references. If you copy this formula down to cell C3, the references will automatically adjust to `B3` and `B2` respectively, maintaining the price comparison logic for that row.

Choosing Between Absolute and Relative:

- Absolute References: Use absolute references when you want the formula to always refer to a specific cell location, even when copied. This is useful for referencing fixed values or rates that shouldn't change based on the formula's position. (e.g., tax rate in a separate cell)

- Relative References: Use relative references for comparisons within the same row or column. This allows the formula to adapt to new data positions when copied.

In summary, absolute references ensure the formula points to a specific cell no matter where it's copied, while relative references adjust their offsets based on the new location.