Making decisions based on multiple factors is a common requirement when working with spreadsheets. The IF formula in Google Sheets lets you check conditions and show different results based on whether those conditions are true or false. When you need to evaluate more than one condition at a time, such as checking product stock levels and sales performance, the IF formula becomes even more powerful.
In this article, we will show you how to use the IF formula in Google Sheets with multiple conditions. We’ll explore simple ways to apply logical rules using AND, OR, and other functions to return custom results. This will help you make decisions automatically in your spreadsheet based on several criteria.
Steps for combining IF with AND function:
➤ Open your Google Sheets file containing the student dataset.
➤ Click on the cell where you want to display the result, cell E2.
➤ Type the formula: =IF(AND(B2>=75, C2>=75, D2=”Yes”), “Pass”, “Fail”)
➤ Press Enter to apply the formula to that row.
➤ Drag it down to apply the formula to all the other rows (E3 to E11).
➤ You will now see “Pass” for students who meet all conditions and “Fail” for the rest.
Combining IF with AND Function
We are working with a student performance dataset that includes student name, marks, attendance, and assignment submitted.
The AND function checks whether multiple conditions are true at the same time, and the IF function uses that result to determine the final output. So, this formula results only when all specified conditions are met. Compared to using multiple separate IF statements, this approach is cleaner and more efficient for logical filtering.
From this dataset, we will extract rows where the marks are 75 or above, attendance is 75% or higher, and the assignment is submitted. Based on these conditions, we’ll return either “Pass” or “Fail” for each student.
Here’s how you can apply this formula:
➤ Open your Google Sheets file containing the student dataset.
➤ Click on column E and name it as “Status.”
➤ Click on the cell where you want to display the result, cell E2.
➤ Type the formula:
=IF(AND(B2>=75, C2>=75, D2=”Yes”), “Pass”, “Fail”)
Press Enter to apply the formula to that row.
➤ Drag it down to apply the formula to all the other rows (E3 to E11).
➤ You will now see “Pass” for students who meet all conditions and “Fail” for the rest.
Combining IF with OR Function
We will use the IF function combined with OR to check if any one of multiple conditions is true. The OR function checks more than one condition. If any one of the conditions is true, it gives the result you want. If none of the conditions are true, it gives a different result.
You should use this method when the result doesn’t need all the conditions to be true; just one condition is enough. It’s more flexible than IF with AND, which requires all conditions to be true.
From this dataset, we will apply this method to check if a student either has marks ≥ 75, or attendance ≥ 75%, or has submitted the assignment. If any of these is true, we’ll return Eligible; otherwise, Not Eligible.
Steps:
➤ Click on column E and name it as “Status.”
➤ Type the following formula in cell E2
=IF(OR(B2>=75, C2>=75, D2=”Yes”), “Eligible”, “Not Eligible”)
➤ Press Enter to apply the formula.
➤ Drag it down to fill the formula for the other rows, E3 to E11.
➤ It will return which students are eligible based on at least one matching condition.
Combining AND and OR with IF (more complex scenarios)
The AND function checks if all required conditions are true, while the OR function checks if at least one optional condition is true. When combined inside IF, they let us build more complex logic, like checking if students meet all core requirements. This helps us create flexible rules based on real-life situations.
This method is useful when your condition has some parts that must all be true (AND) and some that are optional (OR). This gives you more control than using just AND or OR alone.
From the dataset, this will return “Selected” if a student has marks ≥ 75 AND (either attendance ≥ 75% OR the assignment is submitted). Otherwise, we’ll return Not Selected.
Steps:
➤ Click on column E and name it as “Status.”
➤ Click on cell E2.
➤ Type the following formula:
=IF(AND(B2>=75, OR(C2>=75, D2=”Yes”)), “Selected”, “Not Selected”)
➤ Press Enter to apply the formula.
➤ Drag it down to fill the formula for the other rows, E3 to E11.
➤ You will now see “Selected” for students who meet the condition:
Marks ≥ 75 AND (Attendance ≥ 75% OR Assignment Submitted = Yes).
Handling Multiple Conditions with IFS Function
The IFS function is used when you have more than two conditions to check. It works like multiple IF statements combined together but written in a cleaner and more readable way.
IFS checks each condition in order and returns the result for the first condition that is true.
The IFS function helps you check multiple conditions and returns different results for each. It’s easier to read and manage than using many nested IF formulas.
In this dataset, we’ll use it to label students as Excellent, Good, Average, or Needs Improvement based on their marks.
Steps:
➤ Click on column E and name it “Remarks.”
➤ Type the following formula in cell E2
=IFS(B2>=90, “Excellent”, B2>=80, “Good”, B2>=70, “Average”, B2<70, “Needs Improvement”)
➤ Press Enter to apply the formula.
➤ Drag it down to apply the formula to the rest of the rows (E3 to E11).
➤ You will now see a label like “Excellent,” “Good,” etc., based on each student’s marks.
Frequently Asked Questions
What is the IF function in Google Sheets?
The IF function tests a condition and returns one value if the condition is true, and another if it’s false
Can IF formulas handle text and numbers?
Yes, IF works with both text and numeric values in Google Sheets
Can I combine AND and OR in one IF formula?
Yes, it is more complex logic to match real-life scenarios.
Wrapping Up
Using the IF formula in Google Sheets is a simple way to automate decisions based on your data. It’s especially useful for tracking performance, filtering results, or managing tasks that depend on specific conditions. It helps you make quick, accurate decisions based on your data without doing it manually.