DEV Community

Andrews
Andrews

Posted on • Originally published at geekexcel.com on

Excel Formulas to Check If the Cell Value is (X and Y)!!

The IF function is the main logical function in Excel. In this tutorial, we come up with a new formula based on the IF AND statement. Have you ever tried to test some values if the cell value meets a specific condition (such as X and Y)? Here are some cute formulas for you to solve this problem in Excel. Let’s jump into this article!! Get an official version of ** MS Excel** from the following link: https://www.microsoft.com/en-in/microsoft-365/excel

If cell is X and Y
If the cell is X and Y

Generic Formula:

  • Use the below formula to test the cells with X and Y in Excel.

=IF(AND(A1=”X”,B1=”Y”),”True Result”,”False Result”)

Syntax Explanations:

  • IF – In Excel, the IF function helps to return one value for a TRUE result, and another for a FALSE result.
  • AND – The AND Function checks multiple Conditions and returns **TRUE **if all the conditions are evaluated as true otherwise returns FALSE.
  • A1, B1 – It is the input data from your worksheet.
  • Criteria (X, Y) – It is the criteria that want to be found.
  • Comma symbol (,) – It is a separator that helps to separate a list of values.
  • Parenthesis () – The main purpose of this symbol is to group the elements.

Example:

Refer to the below example image.

  • First, we will give the input values in Column B and Column C.

Input Ranges
Input Ranges

  • Then, apply the above-given formula to the formula bar section and press the “Enter” key.

Enter the formula
Enter the formula

  • Finally, we will get the result in the selected cell as shown in the below image.

Result
Result

Verdict:

Hope you like this article about how to test if the cell value is (X and Y) in Excel? Let me know if you have any doubts regarding this article or any other Excel/VBA topic. Thank you so much for visiting our site!! Click here to know more about *Geek Excel **and Excel Formulas *!! **

Related Articles:

Top comments (0)