In this article:

How to use the Google Sheets IF Function (The Right Way!)

The IF function in Google Sheets…
 

The IF function is one of the simplest tools in Google Sheets and also one of the most powerful. It works to check for a particular condition across the cells in your spreadsheet and to return one value when the condition is met and another when it is not. As a standalone tool, it is a great way to help sort data and automate a tedious input process. It’s also an essential building block to perform more complex operations in concert with other tools. 

IF Function Google Sheets Syntax

=IF(logical_expression, value_if_true, [value_if_false])

Where: 

logical_expression=

The condition for which each cell will be checked. Google Sheets allows you to indicate the condition with a number or an exact string of text and at least one of the following logical operators:  

  • Equals (=)
  • Not equal to (<>)
  • Greater than (>)
  • Greater than or equal to (>=)
  • Less than (<)
  • Less than or equal to (<=)

value_if_true=

The value returned if the condition is TRUE.

 value_if_false=

The final, optional argument allows you to specify a value to be returned when the condition is FALSE. When left blank, it will simply return no value for the cells in which the logical expression is FALSE.

IF Function Google Sheets Examples

Using The IF Function With A Single Condition

We’ll walk you through the basics of the Google Sheets IF function by starting with its primary purpose: producing different values based on the TRUE or FALSE result of a logical expression, such as equal to (=) or greater than (>). 

Let’s say a group of ten students were given a placement test to determine which of two classes they would be taking for the semester—with students who scored 50 or higher going to Class A and students scoring 49 or lower going to Class B. We can use the IF function to automatically populate the Assignment column based on the data in the Score column.  

IF function Google Sheets

1. Type =IF( in the appropriate cell

Google Sheets IF function

Choose the first cell you’d like the function to populate and enter the first part of the syntax. In cases like our example, where you want to fill a whole column with results produced by a corresponding one, begin at the top. 

2. Add your condition 

IF statement Google Sheets

We want the function to check the preceding cell in the row for a value greater than or equal to 50. To do so, we simply select the relevant cell, add our logical operator (in this case: >=), and the number to which it applies (50). 

3. Add the value returned for a TRUE result 

IF Google Sheets

For the second argument, simply enter the value you want the function to return when the condition is calculated as TRUE. In cases where the value is a string of text rather than a numeral, encase it in quotation marks. In our example, we want the function to assign students to the proper class. Those who scored greater than or equal to 50 go to Class A. 

4. Add the value returned for a FALSE result

How to use if function in Google Sheets

In our example, we want students who scored 49 or lower—and thus did not meet the condition indicated by our logical expression—to be assigned to Class B, so we simply enter the text embedded in quotation marks. In cases where you only want a value produced for a TRUE result, you can leave this final argument blank. 

5. Type ) and hit return 

IF statements in Google Sheets

Close out the syntax and hit return to see your result. 

6. Fill remaining cells

IF formula Google Sheets

With the first row completed, you don’t need to manually enter the syntax in the remaining cells of the column. Simply accept Google Sheets’ autofill suggestion or use the mouse to select the cell containing the formula and drag to apply it to the relevant cells. 

Using The IF Function with Text

You can also use it to generate a value from cells populated by an exact string of text.

Continuing from our previous example, let’s say that the students in Class A will be participating in the school’s advanced track and we want another column to indicate whether or not a student is on that track. 

1. Type =IF( in the appropriate cell

2. Add your condition 

Google Sheets tutorial

Select the appropriate cell, add the equals sign (=) and enter the text in quotation marks. Because the function relies on logical operators, the cell must only include the quoted text—it will not recognize cells in which the quoted text forms only a part. 

3. Add the value returned for a TRUE result 

4. Add the value returned for a FALSE result-

5. Type ) and hit return 

6. Fill remaining cells with the formula

Google Sheets how to

Sample Sheet

Click here to access our example spreadsheet where you can practice and master this essential skill.

Related Functions

This helpful function in Google Sheets can also be harnessed as a building block to perform more complex tasks in combination with other functions and operators. Here are some of the other if functions you can use:

SUMIF: SUMIF sums data in a range which meet a specific condition.

SUMIFS: Use SUMIFS to tally numbers in a range that meet more than one condition.

COUNTIF: In Google Sheets, COUNTIF can be used to count numbers in a range which meet a given criterion.

COUNTIFS: Counts numbers in a range meeting multiple different criteria.

COUNT IF Not Empty: Learn how to count cells that are not empty.

IFS: IFS is a more elegant way to evaluate data against multiple criteria. 

IFERROR: IFERROR is a tool that searches Google Sheets data for errors and replaces error messages with specified text or a blank cell. 

IF THEN: IF THEN in Google Sheets allows you to evaluate data against a condition and take a corresponding action when the result is TRUE. 

IF AND: Combining the IF and AND functions allows you to include multiple conditions that must be met to return a TRUE result.

IF ELSE: Google Sheets’ IF ELSE statement evaluates a condition, and takes one action when the result is TRUE and a different one when the result is FALSE.

Multiple IF statements: Nesting multiple IF arguments allows you to for TRUE or FALSE results against more than one logical expression


IF OR: IF OR evaluates multiple conditions and produces a TRUE result when any of them are met.

IF Contains: By combining three different Google Sheets tools, you can search for cells that contain particular text. 

AVERAGEIF: Use AVERAGE IF to calculate an average for numbers within a data range which meet provided criteria. 

Use our workflow approval software to automate approvals for every use case and team directly from your spreadsheet in just a few clicks. 

If you want to learn how to send emails from Google Sheets, we also suggest checking out our detailed guide. 

Schedule a free automation consult
Learn more

Automate repetitive tasks with Lido

Save hours on repetitive and tedious work. Lido is a new spreadsheet that connects your spreadsheets, forms, PDFs, and email inbox.

Trigger
Action
Select trigger
When a cell value in Google Sheets changes
Check Google Sheets for today's date
When a new row is added to Google Sheets
On new Google Form submission
Send me a daily reminder
On new Typeform submission
When a cell value in database changes
Check database for today's date
When a new row is added in database
When a new HubSpot customer is created
Select action
ADDCALENDAREVENT
Creates a one- or multiple-day calendar event with optional attendees
ADDHUBSPOT
Adds an object to Hubspot
ADDSLACKCHANNEL
Create a Slack channel, and optionally add a topic or members
CALLURL
Makes any HTTP request
CREATEGOOGLEDOC
Replaces [@column_name] values in a Google Doc with the corresponding table row's values
CREATEPDF
Replaces [@column_name] values in a Google Doc with the corresponding table row's values, then export it as a PDF
FETCH
Makes any HTTP request and returns the response
INSERTROWS
Inserts given array below defined values in given worksheet
SENDGMAIL
Sends an email using your Google account
SENDOUTLOOK
Sends an email using your Microsoft Outlook account
SENDSLACK
Sends a Slack message
SENDSMS
Sends an SMS message using your Twilio account
UPDATECELL
Updates cells with given values
UPDATEHUBSPOT
Updates a property of a Hubspot object
Trigger is required
Action is required
Get started