DEV Community

Andrews
Andrews

Posted on • Originally published at geekexcel.com on

Excel Formulas to Check If the Cell is This or That with OR Function!!

One of the most common tasks in Excel is checking whether a cell contains a given value or not. If you want to do something specific when a cell equals either this or that , you can use the IF function along with the OR function in Excel. In this article, we will provide some cute formulas to solve this problem. Let’s get 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 contain this or that
If cell contains this or that

Generic Formula:

  • Use the below formula to find if the cell value is equal to this or that.

=IF(OR(A1=”this”,A1=”that”),”x”,”y”)

Syntax Explanations:

  • IF – In Excel, the IF function helps to return one value for a TRUE result, and another for a FALSE result.
  • OR – It is a logical function to test multiple conditions at the same time. The OR Function helps to return either TRUE or FALSE.
  • A1 – It is the input data from your worksheet.
  • 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.

Practical Example:

Refer to the below example image.

  • First, we will enter the input values in Column B.

Input Ranges
Input Ranges

  • Then apply the above-given formula to the formula bar section.

Enter the formula
Enter the formula

  • Finally, it will display the result as per the below image.

Result
Result

Conclusion:

From this short tutorial, we have described the simple formula used to find if the cell is equal to this or that in Excel by using the IF function along with the OR function. If you have any doubts, let me know in the below comment box. Thank you so much for visiting our site!! Click here to know more about *Geek Excel **and Excel Formulas *!! **

Related Articles:

Top comments (0)