Get instant live expert help with Excel or Google Sheets
“My Excelchat expert helped me in less than 20 minutes, saving me what would have been 5 hours of work!”

#### Post your problem and you’ll get Expert help in seconds.

Your message must be at least 40 characters
Our professional Expert are available now. Your privacy is guaranteed.

# How to Use “IF CELL IS THIS OR THAT”

We can use a formula that combines the IF and OR functions to return a value if a cell contains either of two values. The formula returns a TRUE or FALSE or whatever we have specified. The steps below will walk through the process.

Figure 1: Result for IF A CELL CONTAINS THIS OR THAT

## General Formula

`=IF(OR(A4="this",A4="that"),"YES","")`

## Formula

`=IF(OR(A4="Vegas",A4="Dallas"),"YES","")`

## Setting up the Data

We will use the data below that show the yearly sales for a product in different states at different times by a company. We intend to check each cell if it contains Vegas or Dallas.

• We will input the states in Cell A4 to Cell A13
• We will input the yearly sales in Cell B4 to Cell B13
• Cell C4 to Cell C13 will contain the results that are returned by the formula. “YES” is returned if the cell contains VEGAS or DALLAS and an empty cell is returned if the cell does not contain VEGAS or DALLAS

Figure 2: Setting up the Data for IF A CELL CONTAINS VEGAS or DALLAS

## If a Cell Contains Vegas OR Dallas

• We will click on Cell C4
• We will insert the formula below into Cell C4

`=IF(OR(A4="Vegas",A4="Dallas"),"YES","")`

• We will press the enter key

Figure 3: Result for Cell C4 IF A CELL CONTAINS VEGAS or DALLAS

• We will click on Cell C4 again
• We will double-click on the fill handle (the small plus sign at the bottom right of Cell C4) and drag down to copy the formula into the other cells

Figure 4: Result for IF A CELL CONTAINS VEGAS or DALLAS

## Explanation

`=IF(OR(A4="Vegas",A4="Dallas"),"YES","")`

In this formula, the OR function checks the specified cell if it contains either VEGAS or DALLAS. The IF Function returns TRUE or FALSE based on what is returned by the OR function. However, we have specified that the IF FUNCTION returns YES as TRUE and an EMPTY CELL (“”) as FALSE.

## Instant Connection to an Expert through our Excelchat Service

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

### Did this post not answer your question? Get a solution from connecting with the expert.

Solution examples
I have a list or people who are ranked in numbers from 3 to 6 I need to recognize the contents of each multiple cells and create an equivalent letter. for that value into another column. e.g. Cell E1 = 3 to show in new cell that row (H1) the letter "C" I have multiple rows with different values in column "E" Can this be done?
Solved by I. J. in 30 mins
Could you help me by explaining the IF function?
Solved by G. L. in 24 mins
I want to display a range of cells if they meet a specific criteria. I want to display a name IF it does not equal one of three options AND there are any numbers contained in a range of cells
Solved by G. F. in 60 mins
I have a question about Conditional Formatting. =IF('Sheet1'!A1="X",IF('Sheet1'!B1="Y", TRUE, FALSE),FALSE) the set the cell background to red. I would like to make it so that if Sheet1'!B1="Z" I set the back to blue. How can I achieve this.
Solved by B. F. in 39 mins
I need to find out if the 2018 yearly sales goals were met if the yearly sales were \$25,000 or more using an IF logical function and to set the formula to return a value of YES if met, and NO if not
Solved by A. A. in 18 mins