How can I create an IF function in Google Sheets that will return “Yes” or “No” based on a condition?

The IF function in Google Sheets is a conditional statement that allows users to create a formula that will return a specific value or outcome based on a given condition. This function can be used to determine if a certain condition is met and return a “Yes” or “No” response accordingly. Users can specify the condition and the desired outcomes, making it a versatile tool for data analysis and decision making. By using the IF function, users can easily determine whether a specific condition is true or false and get a clear “Yes” or “No” response, simplifying complex data analysis tasks in Google Sheets.

Google Sheets: Create IF Function to Return Yes or No


You can use the following basic syntax to create an IF function in Google Sheets that returns “Yes” or “No” as a result:

=IF(A2>=B2, "Yes", "No")

For this particular formula, if the value in cell A2 is greater than or equal to the value in cell B2, the function returns “Yes.”

Otherwise it returns “No.”

The following examples show how to use this syntax in practice.

Example: Create IF Function to Return Yes or No in Google Sheets

Suppose we have the following two columns in Google Sheets that show the sales and sales targets for ten different products:

We can type the following formula into cell C2 to return “Yes” if the number of sales in cell A2 is equal to or greater than the sales target in cell B2:

=IF(A2>=B2, "Yes", "No")

We can then drag and fill this formula down to each remaining cell in column C:

Google Sheets IF function to return yes or no

The formula returns either “Yes” or “No” depending on whether or not the sales value in column A is greater than or equal to the sales target in column B.

Note that you can place any logical test you’d like in the first argument of the IF function.

For example, you could use <> to test if the values in cell A2 and B2 are equal to each other and return “Yes” if they’re equal or “No” if they are not equal:

=IF(A2=B2, "Yes", "No")

We can then drag and fill this formula down to each remaining cell in column C:

The formula returns “Yes” if the sales and sales target are equal.

Otherwise, the formula returns “No” if the sales and sales target are not equal.

Feel free to use whatever logical test you’d like in the first argument of the IF function depending on what condition you’d like to test.

Additional Resources

The following tutorials explain how to perform other common tasks in Google Sheets:

x