The **IF function** is a very helpful **function in Google Sheets**. It checks whether a statement is **TRUE **or **FALSE**. So, if you want to check valid data in a spreadsheet, this function will help to do that. In this article, we will discuss the anatomy and different uses of the **IF** function. Read along to learn about this easy but effective function.

## What Is IF Function in Google Sheets?

**The IF function** checks a logical condition and returns **TRUE **and **FALSE**. If the expression **matches then the function** will give an output, and if the condition does not match then it will show another output.

#### Syntax

The **Syntax **of the **IF function** is shown below.

**IF(logical_expression, value_if_true, value_if_false)**

#### Arguments

ARGUMENT | REQUIREMENT | Function |
---|---|---|

logical_expression |
Required | A condition to check logical expression for a string or set of strings. |

value_if_true |
Optional | A predefined value if the condition matches. |

value_if_false |
Optional | A predefined value if the condition doesn’t match. |

#### Output

The formula ** IF(X>Y,“Greater”,“Smaller”) **means if the value of X is greater than Y then the condition will match and show “Greater”, otherwise it will show “Smaller”.

## 6 Suitable Examples to Use IF Function in Google Sheets

Suppose, we have a dataset of five students in a high school. We will show the uses of** the IF function** in representing different data types. See the examples below to learn the various uses of this function.

### 1. Using Basic IF Function

We will start by demonstrating the primary application of the **IF** function. Here, we have a dataset where the score of five students in a particular test is mentioned. The minimum pass number is 40. We will use the** IF **function to determine **“Pass” **or **“Fail”**. Follow the steps to learn how to do that.

**📌**** Steps:**

- First, select cell
**D5**and insert the following formula.

`=IF(C5>=40,"Pass","Fail")`

- Next, drag down the
**fill handle tool**to copy the formula to other relevant cells.

**Read More: How to Do IF THEN in Google Sheets (3 Ideal Examples)**

### 2. Utilizing the Nested IF Function

We can use the **nested IF function** to get data also. If there is another or more** IF** functions inside an **IF** function then it is called a** nested IF function**. In this dataset, we have some grading standards mentioned in the second table and we will use them for applying grades in the dataset. Follow the steps below to be able to do that.

**📌**** Steps:**

- First, select cell
**D5**and insert the formula in the formula bar.

`=IF(C5<40,"F",IF(C5<=59,"D",IF(C5<=69,"C",IF(C5<=79,"B",IF(C5>=80,"A"))))`

- Then, drag down or
**double-click**on the**fill handle tool**to copy the formula in relevant cells.

### 3. Applying IF with AND Function

We can combine other functions with **the IF function **and get desired data. In this case, we will use the **IF **function with **the AND function**. The **AND **function checks if all the given arguments are true and then returns true, but if any of the arguments is false it will return false. Follow the steps below to apply these by yourself.

**📌**** Steps:**

- First, select cell
**E5**and insert the following formula.

`=IF(AND(C5>=80,D5>=90),"GRANTED","REJECTED")`

- After that, drag down the
**fill handle tool**to apply the same formula to the rest of the cells.

### 4. Using IF with OR Function

We can also use the **IF **function and the **OR **function together to get decisions to any logical expression. **The OR function** checks if any of the given arguments is true then returns true, but if none of the arguments is true then it will return false. In this example, we will show the application of these two functions together to get a logical result. See the steps mentioned below to be able to do that.

**📌**** Steps:**

- First, select cell
**E5**and enter the below formula in the cell.

`=IF(OR(C5>=40,D5>=40),"PASS","FAIL")`

- Next, use the drag down or double click of the
**fill handle tool**to copy the formula to other relevant cells.

**Read More: How to Use IF and OR Formula in Google Sheets (2 Examples)**

### 5. Applying IF with ISNUMBER, ISTEXT Functions

**The IF function** can be combined with the **ISNUMBER **and the **ISTEXT **functions to check whether the value is a number or text. This formula can help to visualize or arrange data adequately. Follow the steps to learn how to do that.

**📌**** Steps:**

- First, insert the following formula in cell
**D5**.

`=IF(ISTEXT(C5),"Subject",IF(ISNUMBER(C5),"Score"))`

- Then, you can copy the cell using the drag down of the
**fill handle tool**.

**Read More: ****How to Use Multiple IF Statements in Google Sheets (5 Examples)**

### 6. Utilizing IF and DATE Functions

Applying** the DATE function** with the **IF **function helps to take a logical decision related to dates. The **DATE **function simply returns a date. Here, follow the steps to learn how to use the combination of these two formulas to get a logical decision in a dataset.

**📌**** Steps:**

- First, insert the following formula in cell
**D5**.

`=IF(C5<=DATE(2012,12,12),"Present","Late")`

- Then, drag down the
**fill handle tool**to copy to other cells.

- You can also apply the following formula in cell
**D5**.

`=IF(C5<=$C$12,"Present","Late")`

- Here,
**C12**carries the date which will be used as a reference to take the decision. After inserting the formula, drag it down to copy to other relevant cells.

**Read More: ****Find if Date is Between Dates in Google Sheets (An Easy Guide)**

## Things to Remember

- Though we mentioned the 2nd and 3rd arguments of the
**IF**function are optional, however, if you don’t put the 2nd argument then the function will not work. It will ask for a statement to complete the function. - Again, if you put the 2nd and 3rd arguments blank and use a comma to complete the function, then the formula will return 0 as result.
- You can use only one logic in an
**IF function**, if you want to apply multiple logic then you have to use the**nested IF function**. - You can use
**SUMIF**and**COUNTIF**functions in the sum-based and count-based conditions. They are preset combined versions of the**IF**function.

## Conclusion

We have tried to show you the use of the **IF** function in Google Sheets. Hopefully, the examples above will be enough for you to understand the applications of the function. Please use the comment section below for further queries or suggestions. You may also visit our **OfficeWheel** blog to explore more about Google Sheets.

**Related Articles**

**Highlight Row Based on Date in Google Sheets (2 Suitable Ways)****How to Highlight Row If Cell Is Not Empty in Google Sheets****Highlight Cell If Value Exists in Another Column in Google Sheets****How to Use IF Condition Between Two Numbers in Google Sheets****Conditional Formatting with Multiple Conditions Using Custom Formulas in Google Sheets****Google Sheets: Conditional Formatting with Multiple Conditions**