How to Use IF and IFS in Google Sheets
Make your spreadsheets smarter. This guide shows you how to use the IF and IFS functions, and combine them with the powerful VLOOKUP function to check conditions, assign categories, and automate decisions—no advanced skills needed. Perfect for those who want to level up their Google Sheets game.
🧠 What is the IF Function?
The IF function in Google Sheets helps your spreadsheet make a choice based on a condition. You provide a condition to test, and the function returns one result if the condition is true and another result if it is false.
What the formula looks like:
=IF(condition, "answer if true", "answer if false")
Example: Did someone meet their sales target?
Name | Sales | Target | Result |
---|---|---|---|
Alice | 5200 | 5000 | Target Met |
Bob | 4300 | 5000 | Below Target |
To check whether someone’s sales are equal to or higher than their target, you can use this formula in the Result column:
=IF(B2 >= C2, "Target Met", "Below Target")
This formula is saying: If the number in cell B2 (the sales amount) is greater than or equal to the number in C2 (the target), then write “Target Met”. Otherwise, write “Below Target”. It’s a simple way to check if a goal was achieved and automatically label the result.
🧠 What is the IFS Function?
The IFS function is like a more advanced version of IF. It’s perfect for situations where there are several possible outcomes, not just yes or no. Instead of checking just one thing, it checks several, one after another.
What the formula looks like:
=IFS(condition1, "result1", condition2, "result2", ...)
Example: What grade does a student get?
Student | Score | Grade |
---|---|---|
John | 88 | B |
Mia | 72 | C |
Kyle | 94 | A |
To assign a grade based on a student’s score, you can use this formula:
=IFS(B2 >= 90, "A", B2 >= 80, "B", B2 >= 70, "C", B2 >= 60, "D", B2 < 60, "F")
This formula goes through each condition in order. It first checks if the score in B2 is 90 or more; if that’s true, it gives an A. If not, it checks if the score is 80 or more, and gives a B. If that’s also not true, it moves to the next option—checking if it’s 70 or more, and so on. The first condition that’s true will decide the result. So, if a student scores 88, the formula returns "B", because 88 is not 90 or more, but it is 80 or more.
📈 More Simple Examples
Bonus Example: Should someone get a bonus?
Let’s say you want to give bonuses to people who sell at least $10,000. You could write:
=IF(B2 >= 10000, "Bonus", "No Bonus")
This means: if the number in B2 is 10,000 or more, write “Bonus”; if it’s less, write “No Bonus.”
Example: How fast did someone respond?
If you’re measuring how many days it took to respond to a customer, and you want to label it as "Immediate", "Fast", "Slow", or "Stale", you could use:
=IFS(A2 <= 1, "Immediate", A2 <= 3, "Fast", A2 <= 7, "Slow", A2 > 7, "Stale")
Here’s what it’s doing: If the number in A2 is 1 or less, it returns "Immediate". If not, it checks whether it’s 2 or 3, and returns "Fast". If it’s between 4 and 7, it returns "Slow". If none of those are true and the number is more than 7, it returns "Stale". The spreadsheet checks the conditions in order, and as soon as one is true, it gives the answer.
⚠️ Things to Watch Out For
The IF function is best when you only need to check one condition, like “Is the number greater than 100?” But when you have several possibilities, IFS is usually better. The downside to IFS is that it doesn’t have a built-in fallback—so if none of the conditions are true, you’ll get an error that says #N/A.
To prevent that, you can add a final condition that always counts as true:
TRUE, "Other"
This acts like a safety net. If no other condition matches, the result will just be “Other” instead of showing an error.
🔄 Can You Combine IF or IFS with VLOOKUP?
Yes! You can absolutely combine IF and IFS with VLOOKUP in the same formula. This is useful when you want to look something up in a table and then make a decision based on that value.
Example: IF + VLOOKUP
Imagine a table with names and sales amounts:
Name | Sales |
---|---|
Alice | 12000 |
Bob | 8500 |
Carla | 10400 |
Let’s say you want to check if Bob gets a bonus based on his sales.
=IF(VLOOKUP("Bob", A2:B4, 2, FALSE) >= 10000, "Bonus", "No Bonus")
This formula looks up Bob’s sales using VLOOKUP. If the number is 10,000 or more, it returns “Bonus”. Otherwise, it returns “No Bonus”.
Example: IFS + VLOOKUP
Now, let’s assign a sales tier to someone:
12,000+ = Platinum
10,000–11,999 = Gold
8,000–9,999 = Silver
Less than 8,000 = Bronze
Formula:
=IFS( VLOOKUP("Carla", A2:B4, 2, FALSE) >= 12000, "Platinum", VLOOKUP("Carla", A2:B4, 2, FALSE) >= 10000, "Gold", VLOOKUP("Carla", A2:B4, 2, FALSE) >= 8000, "Silver", VLOOKUP("Carla", A2:B4, 2, FALSE) < 8000, "Bronze" )
This formula looks up Carla’s sales, runs through the tier system, and assigns a level based on the conditions.
Pro Tip: Use a Cell Reference Instead of a Name
Instead of typing a name like "Carla" into the formula, you can use a cell reference (e.g. E2), so it works for different names:
=IFS( VLOOKUP(E2, A2:B4, 2, FALSE) >= 12000, "Platinum", VLOOKUP(E2, A2:B4, 2, FALSE) >= 10000, "Gold", VLOOKUP(E2, A2:B4, 2, FALSE) >= 8000, "Silver", VLOOKUP(E2, A2:B4, 2, FALSE) < 8000, "Bronze" )
Tip to Avoid Errors
If the name you're looking up doesn't exist, VLOOKUP will show an error. You can avoid that by wrapping the whole formula in an IFERROR:
=IFERROR(..., "Not Found")
This way, if something goes wrong, the cell will just say “Not Found” instead of showing an error message.
🧾 Final Tips
Goal: Check one simple condition
Use This Function: IF
Goal: Check several possible situations
Use This Function: IFS
Goal: Avoid #N/A errors in IFS
Use This Function: Add TRUE, "Other" at the end
Goal: Lookup a value and make decisions based on it
Use This Combo: VLOOKUP with IF or IFS