Google Sheets IF Formula: Syntax, Examples, and Tips

How-to basics · Updated November 3, 2026

Google Sheets IF Formula: Syntax, Examples, and Tips

In Google Sheets, use =IF(A2>=70,"Pass","Review") to test whether the value in A2 is at least 70 and return one result if it is, or another if it is not. Replace the cell reference, condition, and result text with the ones your sheet needs; IF is the standard way to make a formula respond to a condition.

What the IF formula does

IF evaluates a logical test and returns a chosen value according to whether that test is true or false. It is useful when a spreadsheet needs to label, classify, or calculate different outcomes based on its data. For example, a grade sheet can show “Pass” for scores above a threshold, while an order tracker can display a shipping status based on whether an order has been sent.

The function has this structure: =IF(logical_expression, value_if_true, value_if_false). The logical expression is the condition Sheets checks. The second argument is returned when the condition is true; the third is returned when it is false. The false argument is optional: if you leave it out, Sheets returns a blank when the test is false.

A condition can compare numbers, text, dates, or cell contents. Common comparison operators include = for equal to, <> for not equal to, > for greater than, < for less than, and >= or <= for inclusive comparisons. Text results need straight double quotation marks; references and numbers do not.

Build a basic IF formula

Start by identifying the cell to test, the exact condition, and what should appear for each outcome. Suppose scores are in column A and a score of 70 or more counts as a pass. With the score in A2, enter the following formula in B2:

With the score in A2, this formula returns “Pass” when A2 is 70 or higher and “Review” otherwise: =IF(A2>=70,"Pass","Review"). If A2 contains 82, the result is Pass; if A2 contains 64, the result is Review.

After entering the formula, press Enter. To use the same test for additional rows, select the cell with the formula and drag its small blue fill handle down, or copy and paste it into the other result cells. A relative reference such as A2 changes to A3, A4, and so on as the formula is copied. If a threshold is stored in a fixed cell, an absolute reference such as $D$1 can keep that threshold reference from shifting.

For example, with the score in A2 and a pass threshold in D1, the formula below compares the score with that stored threshold: =IF(A2>=$D$1,"Pass","Review"). If A2 is 82 and D1 is 70, it returns Pass. This makes it easier to update the rule by changing D1 instead of editing formulas throughout the sheet.

Use numbers, text, and dates as conditions

IF can return numeric results as well as labels. With a quantity in B2, for example, a sheet can apply a discount amount only when the quantity reaches a specified minimum. With B2 holding the quantity, the formula returns 5 for quantities of 10 or more and 0 for smaller quantities: =IF(B2>=10,5,0). If B2 is 12, the result is 5. The formula only calculates that number; it does not apply currency formatting, which you can set separately with the toolbar’s number-format controls.

Text can be tested too. With a delivery status in C2, the formula below returns “Complete” only if the cell contains the specified word, and otherwise returns “Not complete”: =IF(C2="Delivered","Complete","Not complete"). If C2 contains Delivered, the result is Complete. Sheets’ ordinary text comparisons are generally not case-sensitive, so capitalization differences do not usually change this comparison. Use the EXACT function when a case-sensitive text comparison is needed.

Dates are stored as values, so they can be compared with other dates. With a due date in A2, the formula below returns “Overdue” when that date is before today and “Current” otherwise: =IF(A2<TODAY(),"Overdue","Current"). TODAY updates as the date changes. A blank A2 can create an unintended result in date checks, so decide how blank due dates should be handled before using this formula down a column.

Combine conditions with AND and OR

Use AND when every condition must be true, and OR when at least one condition must be true. Both functions can be placed inside IF’s logical-expression argument. This is clearer and more manageable than trying to combine several comparisons with nested IF functions.

With a score in B2 and attendance percentage in C2, this formula returns “Pass” only when the score is at least 70 and attendance is at least 80%: =IF(AND(B2>=70,C2>=80%),"Pass","Review"). For a score of 82 and attendance of 85%, it returns Pass; if either requirement is missed, it returns Review.

With an order amount in B2 and a membership status in C2, this formula returns “Eligible” if the amount is at least 100 or the customer is a member: =IF(OR(B2>=100,C2="Member"),"Eligible","Not eligible"). A qualifying amount or the exact membership label is enough to meet the condition. When combining operators, use parentheses or AND and OR to make the intended logic explicit; a carefully structured formula is easier to check later.

Handle more than two outcomes

One IF has two possible branches: true and false. If a rule has several thresholds, you can nest IF functions, placing another IF in the false branch. With a score in A2, this formula assigns A, B, C, or “Needs work”: =IF(A2>=90,"A",IF(A2>=80,"B",IF(A2>=70,"C","Needs work"))). For a score of 85, the first test is false and the second is true, so the result is B. The order matters: Sheets checks the conditions from the outside inward and returns the first matching outcome.

Nested IFs can become difficult to read when many categories are involved. The IFS function is an alternative for testing a sequence of conditions. With a score in A2, this version gives the same four categories: =IFS(A2>=90,"A",A2>=80,"B",A2>=70,"C",A2<70,"Needs work"). At 85 it returns B. IFS returns the result paired with the first true condition, so put the most specific or highest-priority rules first. Include a final condition that covers remaining cases, or account for what should happen if no condition is true.

Return a blank when input is missing

A common spreadsheet problem is displaying a label or calculation before a row has any input. An IF check for an empty cell can keep the output column tidy. With an item name in A2, the formula below leaves B2 blank until A2 contains something, then returns “Ready”: =IF(A2="","","Ready"). This is especially useful in templates that have formulas already filled down many rows.

Be aware that a formula returning an empty string is not the same thing as a truly empty cell. It looks blank, but other formulas may treat it differently from a cell that has never contained a value. If later calculations depend on whether a cell is actually empty, test the original input cell where possible, or use a function such as ISBLANK with that distinction in mind.

To apply one IF rule to a column in Google Sheets, ARRAYFORMULA can evaluate ranges and fill results down automatically. With names in A2:A and scores in B2:B, this formula leaves rows without names blank and labels the other scores: =ARRAYFORMULA(IF(A2:A="","",IF(B2:B>=70,"Pass","Review"))). For a row with a name and score 82, the output is Pass; rows without a name remain visually blank. Put the formula in the top output cell and make sure cells beneath it are clear so the results can expand.

IF versus conditional formatting

IF changes the value displayed by a formula cell. Conditional formatting changes how a cell looks while leaving its underlying value intact. For example, use IF if you need a “Late” label that another formula can count; use conditional formatting if you want overdue dates to appear with a red background.

In Google Sheets in a web browser, select the cells and choose Format > Conditional formatting. You can set a rule based on a value or use a custom formula, then choose the formatting style. A custom formula can, for example, highlight an entire row when a status cell contains a particular word. Conditional formatting is not a replacement for an IF formula when you need the result to be text or a number that other calculations can use.

It is also possible to use both: an IF formula can create a meaningful status, and conditional formatting can make that status easier to scan. Keep the calculation and the visual rule conceptually separate so a color change is not mistaken for a change in the cell’s actual value.

Common IF formula problems

  • Missing quotation marks: Text results such as Pass must be enclosed in straight double quotation marks. A word typed without quotes may be interpreted as a named range or produce an error.
  • Wrong comparison operator: Use <> for “not equal to”; the symbol != is not the standard Google Sheets comparison operator.
  • Unexpected blanks: A blank cell can behave like a zero in some comparisons. Add an explicit empty-cell check if blank inputs should not be classified as zero or assigned an outcome.
  • Inconsistent data types: A number stored as text may not behave like a numeric value in a comparison. Check the cell’s contents and number format, and convert or clean imported data if necessary.
  • Locale-specific separators: Many Sheets files use commas between function arguments, but some spreadsheet locales use semicolons. If a correctly structured formula is rejected, check the spreadsheet’s locale under File > Settings and use the separator expected by that locale.
  • Formula results do not expand: An ARRAYFORMULA needs empty cells in its output area. Existing values in the way can prevent results from appearing for the full range.

When troubleshooting, inspect the formula from left to right: confirm the tested cell, verify the comparison, and check that each true and false result is the intended type. Parentheses and commas must be balanced in the formula bar. A small test with one known true case and one known false case often reveals a reversed condition or misplaced result faster than editing a long formula at random.

Google Sheets and Excel differences

The basic IF function and examples shown here are also familiar to Excel users, and the core formula syntax is substantially the same. Google Sheets formulas are entered in cells in the browser and use the spreadsheet’s locale for separators; Excel also uses locale-dependent separators. If a workbook or sheet uses a different locale, commas in an example may need to be semicolons.

Menus and some features differ between the programs. The Google Sheets path for conditional formatting is Format > Conditional formatting; Excel has its own ribbon-based Conditional Formatting commands. Do not assume that instructions for one application’s menus apply to the other. For the IF calculation itself, however, the main ideas—test a condition, return one result if true, and another if false—transfer readily.

Frequently Asked Questions

What is the IF formula in Google Sheets?
The IF function checks a logical condition and returns one value when it is true and another when it is false. Its general pattern is =IF(logical_expression, value_if_true, value_if_false).

How do I write an IF formula with text?
Put text outcomes in straight double quotation marks. For example, with a score in A2, =IF(A2>=70,"Pass","Review") returns Pass for 70 or higher and Review for a lower score.

Can Google Sheets IF return a blank?
Yes. Use an empty string as the result, written as two quotation marks with nothing between them. With an input in A2, =IF(A2="","","Ready") leaves the result looking blank when A2 is empty.

How do I use multiple conditions in an IF formula?
Put AND or OR inside the logical test. AND requires every condition to be true, while OR requires at least one to be true. For several possible outcomes, nest IF functions or use IFS.

Why does my Google Sheets IF formula show an error?
Check quotation marks, parentheses, comparison operators, and argument separators first. Your spreadsheet locale may require semicolons instead of commas. Also confirm that values you intend to compare as numbers are not stored as text.

Can I copy an IF formula down a column?
Yes. Copy it or drag its fill handle down; relative references adjust for each row. Use dollar signs in a reference such as $D$1 when that part of the formula should stay fixed as you copy.

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.