Google Sheets IF Else: How to Write Conditional Formulas

How-to basics · Updated November 3, 2026

Google Sheets IF Else: How to Write Conditional Formulas

Google Sheets does not have a separate ELSE keyword; use the IF function to test a condition and return one result when it is true and another when it is false. For example, with a score in B2, =IF(B2>=70, "Pass", "Review") displays Pass for a score of 70 or higher and Review otherwise.

How IF and “else” work in Google Sheets

In a spreadsheet, an IF formula evaluates a logical test, such as whether a number meets a threshold or whether a cell contains a particular word. The formula then returns a value based on the test. The part that supplies the false-case result is effectively the “else” branch: it is the third argument in IF, not a separate command.

The general structure is =IF(logical_expression, value_if_true, value_if_false). In Google Sheets, the first argument must be a test that can be evaluated as TRUE or FALSE. The next two arguments can be text, numbers, cell references, or other formulas. Text results need straight double quotation marks; a cell reference or number does not.

  • Condition: the test to evaluate, such as whether B2 is at least 70.
  • True result: what to show when the test passes.
  • False result: what to show when it does not.

If you leave out the false-result argument, Sheets returns a blank when the condition is false. That can be useful, but it can also hide cases you meant to label, so include the third argument when a visible alternative matters.

Write a basic IF formula

Click the cell where the answer should appear, type an equals sign and the formula, then press Enter. In a typical Google Sheets web spreadsheet, function arguments are separated with commas. For a straightforward pass/fail check, assume B2 contains a student’s score; this formula returns Pass for 70 or more and Review for anything lower:

=IF(B2>=70, "Pass", "Review")

Here, >= means “greater than or equal to.” Other common comparison operators include > (greater than), < (less than), <= (less than or equal to), = (equal to), and <> (not equal to). You can compare a cell with a number, text, or another cell. Text comparisons are usually written in quotation marks; for example, assuming A2 contains a status, =IF(A2="Paid", "Complete", "Not complete") returns Complete only when the status is Paid.

To use the same logic for more rows, copy or drag the formula down. Relative references such as B2 adjust to B3, B4, and so on. If a threshold is stored in a fixed cell, such as D1, use an absolute reference so it does not move as you fill the formula: assuming B2 is the score and D1 is the required score, =IF(B2>=$D$1, "Pass", "Review") compares each row with the same threshold.

Use multiple conditions with AND and OR

Sometimes one test is not enough. Use AND inside IF when every condition must be true. Suppose B2 contains a score and C2 contains an attendance percentage expressed as a number from 0 to 1. With those values in place, this returns Eligible only when the score is at least 70 and attendance is at least 0.8 (80%):

=IF(AND(B2>=70, C2>=0.8), "Eligible", "Not eligible")

Use OR when meeting any one of several conditions should trigger the true result. Assuming A2 contains a customer’s membership level, the following returns Discount for either Gold or Silver and Standard for other entries:

=IF(OR(A2="Gold", A2="Silver"), "Discount", "Standard")

AND and OR can contain more than two tests. Keep the rules readable, though: when a formula becomes difficult to inspect, splitting the calculation into helper columns can make it easier to audit and update. Also check whether your tests match the intended rule. “At least 70” includes 70; “above 70” does not.

Handle three or more outcomes

For several possible results, you can put one IF inside another. This is called a nested IF. Assume B2 contains a score: the formula below labels scores of 90 or more A, scores of 80 or more B, and all lower scores C.

=IF(B2>=90, "A", IF(B2>=80, "B", "C"))

Order matters. The formula checks the 90-point condition first, then checks 80 only if the first test is false. A score of 95 therefore receives A, not B. If thresholds overlap, start with the most restrictive or highest threshold and work downward. Parentheses should balance; a missing closing parenthesis is a common cause of a formula parse error.

Google Sheets also has IFS for testing a sequence of conditions without nesting IF functions. With a score in B2, this returns A for 90 or higher, B for 80 or higher, C for 70 or higher, and F otherwise:

=IFS(B2>=90, "A", B2>=80, "B", B2>=70, "C", TRUE, "F")

IFS checks pairs from left to right and returns the result for the first true condition. The final TRUE condition acts as a catch-all, similar to an else branch. Without a condition that matches, IFS can return an error, so include a final fallback when every possible input should receive a result. Nested IF is still useful when the logic is small or when a later test depends on an earlier result.

Decide what to do with blank cells

A blank input can create misleading output. For example, a blank cell may behave like zero in some numeric comparisons, so a score formula could label an empty row as a failing result. Test for blank first if an empty input should produce an empty output. Assuming B2 is the score, this formula leaves the result blank until B2 contains something, then applies the 70-point threshold:

=IF(B2="", "", IF(B2>=70, "Pass", "Review"))

This is different from returning a space character or the text “blank”: those are visible text values and can affect sorting, counts, and later formulas. If a cell might contain a formula that returns an empty string, checking whether it equals an empty string is often useful. If you need to distinguish a truly empty cell from a formula-generated empty string, use a more specific test and verify it against your sheet’s data.

Prevent or explain errors

IF can choose between outcomes, but it does not automatically catch every error produced by a calculation. For example, dividing by zero can return an error. IFERROR is designed to return a chosen fallback when its first argument results in an error. Assume B2 contains a numerator and C2 a denominator; this returns the division result unless it produces an error, in which case it displays Check inputs:

=IFERROR(B2/C2, "Check inputs")

Use a specific IF test instead when you want to handle a known situation and preserve other errors for investigation. With a numerator in B2 and denominator in C2, this checks for a zero denominator before dividing:

=IF(C2=0, "Cannot divide by zero", B2/C2)

That approach makes the intended rule clear, while IFERROR can be convenient for a general fallback. Avoid replacing every error with an empty string without understanding the cause; doing so can conceal misspelled references, unexpected text, or broken source data.

Apply IF logic to a whole column

For a small table, filling a formula down is usually the clearest choice. Google Sheets also supports ARRAYFORMULA, which can apply a calculation to a range at once. Suppose column A contains names and column B contains scores, starting in row 2. Put this formula in C2 to leave rows without a name blank and classify the remaining scores:

=ARRAYFORMULA(IF(A2:A="", "", IF(B2:B>=70, "Pass", "Review")))

The output will expand down column C, so keep that area clear of existing values that could block the results. Array formulas are helpful for growing lists, but they can be less convenient when individual rows need different logic. For a fixed, short dataset, a copied-down IF formula may be easier for someone else to understand.

IF formulas versus conditional formatting

Choose IF when you need a calculated result in a cell, such as a label, amount, or next action that other formulas can use. Choose conditional formatting when the value is already present and you only want to change its appearance, such as highlighting low scores. In Google Sheets in a web browser, select the cells, then choose Format > Conditional formatting and set a rule in the side panel. This changes formatting, not the underlying cell value.

For example, you could use an IF formula in column C to display Pass or Review, then apply conditional formatting to emphasize Review. Keeping the decision and the visual cue separate makes the sheet more useful: users can filter or count the text result, while color provides a quick visual signal. Do not rely on color alone when the distinction is important to read or analyze.

Common formula problems and fixes

  • Formula parse error: Check for a missing parenthesis, an unmatched quotation mark, or a separator that does not match the spreadsheet’s locale. Some locales use semicolons between arguments instead of commas; the file’s locale is available under File > Settings.
  • Unexpected result for text: Make sure text values are in quotation marks and match the source data. Extra spaces or inconsistent labels can make a comparison fail.
  • Blank rows show a result: Add a blank check before the main test, especially when an empty cell could be treated like zero.
  • Copied formulas use the wrong reference: Use dollar signs to lock a fixed cell reference, such as $D$1, when filling a formula across rows or columns.
  • Threshold outcomes seem wrong: Check the order of nested IF or IFS tests and verify whether the rule should use greater than or greater than or equal to.

When a result is unexpected, inspect the input cells and the formula one condition at a time. Temporarily simplify the test or check the referenced values in nearby cells. This is often quicker than replacing the entire formula, and it helps reveal whether the issue is a comparison, a reference, or the underlying data.

Google Sheets and Excel: what differs?

The basic IF idea is shared by Google Sheets and Microsoft Excel, and the examples here use Google Sheets in a web browser. In both programs, IF tests a condition and returns a true or false result; AND, OR, and nested IF logic are also familiar in both. The interface differs, and available functions or behavior around array calculations can depend on the product and version. Do not assume every Sheets feature or menu path exists in Excel, or vice versa.

In Sheets, the steps and menu names above refer to the browser interface. A formula copied from Excel may need changes if it relies on a function or feature that Sheets does not support, and a formula separator may differ because of locale settings rather than because IF itself works differently. When sharing a spreadsheet between programs, check the result in the destination application instead of assuming that visual similarity guarantees identical behavior.

Frequently Asked Questions

Does Google Sheets have an ELSE function?
No. ELSE is not a separate Sheets function or keyword in a standard IF formula. Put the alternative result in IF’s third argument, or use a final TRUE condition in IFS as a fallback.

Can IF return a blank when the condition is false?
Yes. You can use an empty string as the false result, or omit the optional false-result argument. An empty string looks blank but is not identical to a cell that has never contained a formula.

Can I use more than one IF condition?
Yes. Combine tests with AND when all must be true and OR when any one may be true. For several alternative outcomes, use nested IF or IFS and arrange the tests in the order you want them checked.

Why does my formula show a parse error?
Check parentheses, quotation marks, and argument separators. Depending on the spreadsheet’s locale, Google Sheets may expect semicolons instead of commas. Also confirm that the formula begins with an equals sign.

Should I use IF or conditional formatting?
Use IF when you want a value or label in a cell that can be referenced, filtered, or counted. Use conditional formatting when you only want cells to look different based on their values.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.