How to write IF statement in google sheets?
If you’re new to using Google Sheets or need a refresher, learning how to write an IF statement is a crucial skill.
An IF statement allows you to set conditions for a cell or range of cells to display certain values or perform certain actions based on those conditions.
Features:
- Simple and easy to follow instructions
- It is used for automation in calculation
- It can be used with Data Validation, Conditional Formatting, and Error Checking
Benefits:
- Save time and increase efficiency by automating tasks in your Google Sheets
- Customize your Google Sheets to fit your specific needs
- Improve your data analysis skills by using if statements to filter and organize data
How to Use IF Statement in Google Sheets: Syntax
- The basic syntax of the IF function is:
=IF(logical_expression, value_if_true, value_if_false)
- Think about it this way:
IF(something is true, then do this, else do that)
Write IF Statement in Google Sheets Step-By-Step
The IF function in Google Sheets is a logical function that allows you to test a condition and return one value if the condition is true and another value if the condition is false.
In this example we are going to compare First Quiz column with Second Quiz column, if they match it will type “MATCH” else it will type “DONT MATCH”.

- Start by selecting the cell where you want to write the if statement.
- Begin the statement with the “IF” function, followed by an opening parenthesis.
- Enter the logical test that you want to perform in the first argument of the function. This can be a comparison between two values, such as “B2 = C2” in order to make comparison between the 2 quizzes.
- Add a comma to separate the first argument from the second argument.
- Enter the value or formula that you want to display if the logical test is true in the second argument. This can be a number, text, or another formula. In our example it is a text and I called it “MATCH”, you can call it whatever you like.
- Add another comma to separate the second argument from the third argument.
- Enter the value or formula that you want to display if the logical test is false in the third argument. This can also be a number, text, or another formula. In the example above it is text and I called it “DONT MATCH” and you can rename it to what ever you like.
- Close the function with a closing parenthesis.
- Press enter to complete the if statement and display the result in the selected cell.
IF function and numerical values
You can use numerical values in the logical_test of the IF function to perform comparisons.
For example, you can use the greater than symbol (>) or less than symbol (<) to compare two numerical values.
You can also use the equal to symbol (=) to check if two numerical values are equal as it is shown in the image below.

I would like to give another similar example in order to make it clear for you. In the image below, Google Sheets will simply checks the numerical Grade column and types Fail if the numeric value is below 80 and Pass if it is above 80.

You can combine the IF function with other functions in Google Sheets to perform more complex calculations.
For example, you can use the AVERAGE function to get an average of a range of cells, and then use the IF function to return a specific value based on the result of the AVAERAGE function as shown below.

The ISNUMBER function can be used in conjunction with the IF function to test if a cell contains a number or not. This can be useful for data validation and error checking in spreadsheets.

Tips For Using IF function with numerical values
- When using the IF function with numerical values, it’s important to make sure that the values are formatted correctly.
- You should also be careful when using the equal to symbol (=) to check for equality, as it can sometimes return unexpected results due to rounding errors.
- Finally, you should always test your formulas thoroughly to make sure that they are working correctly.
How do you use if function in Google Sheets for text?
Text values can be used in the IF function to test for specific words or phrases in a cell. For example, you can use the IF function to check if a cell contains the word “yes” and return a specific value if it does, or return a different value if it does not as shown below.

You can also combine text values with other functions in the IF statement to create more complex conditions. For example, you can use the CONCATENATE function to combine text values from different cells and then test for a specific phrase in the combined text. Let us see it in the example below.

Tips For Using IF function with text values
- When using text values in the IF function, it is important to ensure that the text values are consistent and standardized across the spreadsheet.
- This can help to avoid errors and ensure that the function works as intended.
- It is also important to test the function thoroughly before using it in a production environment.
Is there an IF blank function in Google Sheets?
The ISBLANK function is a useful tool in Google Sheets that allows users to check if a cell is empty or not and it is the answer of the question above.
This function returns a TRUE value if the cell is blank and a FALSE value if it contains any data or formula.
It can be used in various ways especially in nested functions, in our example below ISBLANK is testing the cells in column B whether they are blank or not and type TRUE if it is blank and FALSE if it is not.

Can I Use an IF Function in Conditional Formatting in Google Sheets?
Yes, you can use an IF formula in conditional formatting in Google Sheets. I recommend checking this post CONDITIONAL FORMATTING.
Conditional formatting allows you to format cells based on certain conditions, such as if a cell contains a certain value or meets a specific criteria.
To use an IF formula in conditional formatting, you need to create a custom formula rule.

- Start by selecting the cells you want to apply the conditional formatting to.

- Then, go to the “Format” menu and select “Conditional formatting.”

- In the “Format cells if” dropdown menu, select “Custom formula is“
- Enter your formula in the text box, using the syntax =condition, format
- Replace “condition” with the condition you want to test for, I used B2:$C2<80, and replace “format” with the formatting you want to apply if the condition is true, I changed Fill Color to yellow.
- Click “Done” to apply the conditional formatting.
Conclusion
In conclusion, using logical expressions and true/false outcomes in Google Sheets can greatly reduce confusion and simplify data processing.
You can read more about How to write IF statement in google sheets