How to Use IF Statement with Yes or No in Excel (3 Examples)

Using the IF function, it is possible to analyze text, values, and even errors. It extends beyond simply determining whether two things are equal and then giving one answer. Based on our needs, we can also use mathematical functions and perform extra calculations. It allows us to combine numerous functions together for several tests. This article will show you how to use the IF function with a yes or no statement in Excel.


Introduction to IF Function

Objective

The Excel IF function performs a test on a specified condition and outputs two values: one for a TRUE outcome and another for a FALSE one.

Syntax

Syntax for IF Function

=IF(logical_test, value_if_true, value_if_false)

Arguments Explanation

Argument Required/Optional Argument Explanation
Logical_test Required This is the condition to be tested and evaluated as either TRUE or FALSE.
Value_if_true Optional The value that will be returned if the logical_test evaluates to TRUE.
Value_if_true Optional The value that will be returned if the logical_test evaluates to FALSE.

Available in:

  • The IF function is available from Microsoft Excel 2000.
  • Here, we will use Microsoft Excel 365.

3 Suitable Examples to Use IF Statement with Yes or No in Excel

This article will demonstrate how to use the IF function with yes or no statements in Excel. So, we will determine some yes or no comments on the basis of the text, numbers, and different criteria.

Example 1: Applying IF Function for Numbers with Yes or No Statement in Excel

In the first section, we will show how to make an action a comment with a yes or no statement in a sample data set of unit sales and a targeted unit sale column to know how many units have sold.

Sample Data Set for Applying IF Function for Numbers in Excel

  • Firstly, select cell D5.
  • Secondly, write down the following formula.
=IF(B5>=C5,"Yes","No")

Showing Results for Applying Excel IF Function for Numbers with Yes or No Statement

  • Then, press Enter and use the Fill Handle to drag rightward to the remaining cells to see the result.

Showing Results for Applying Excel IF Function for Numbers with Yes or No Statement

Read More: Excel IF Statement Between Two Numbers


Example 2: Using IF Function for Text with Yes or No Statement in Excel

So, in this section, we will show how to make comments with yes or no statements in a sample data set of multiple products and their delivery status.

Sample Data Set for Using IF Function for Text in Excel

  • Firstly, select cell D5.
  • Then, write down the following formula.
=IF(C5="Delivered","Yes","No")

Using Excel IF Function for Text with Yes or No Statement

  • Afterward, press Enter and use the Fill Handle to drag rightward to the remaining cells to see the result.

Showing Result for Using Excel IF Function for Text with Yes or No Statement

Read More: How to Check If Cell Contains One of Several Values in Excel


Example 3: Employing IF Function for Specific Criteria with Yes or No Statement

Finally, in this section, we will demonstrate how to find a specific color with a yes or no statement in a sample data set of multiple colors with specific criteria.

Sample Data Set for Employing IF Function for Specific Criteria

  • Firstly, choose cell C5.
  • Secondly, write down the following formula.
=IF(B5="White","Yes","No")

Employing Excel IF Function for Specific Criteria

  • After that, press Enter and use the Fill Handle to drag rightward to the remaining cells to see the result.

Showing Final Results

Read More: How to Use If Statement Based on Cell Color in Excel


Download Practice Workbook

You may download the following Excel workbook for better understanding and practice it by yourself.


Conclusion

In this article, we’ve covered 3 suitable examples of how to use the IF function with a yes or no statement in Excel. We sincerely hope you enjoyed and learned a lot from this article. If you have any questions, comments, or recommendations, kindly leave them in the comment section below.


Related Articles

Get FREE Advanced Excel Exercises with Solutions!
Bishawajit Chakraborty
Bishawajit Chakraborty

Bishawajit Chakraborty, a Rajshahi University of Engineering & Technology graduate with a B.Sc. in Mechanical Engineering, has been associated with ExcelDemy since 2022. Presently, he is a content developer, specializing in Excel Power Query, Data Analysis and VBA. It is worth mentioning that he has authored more than 90 articles on VBA content development. His profound interest lies in the fields of data analytics and data science. He possesses expertise in VBA, Power BI, machine learning, and Python... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo