
return some value to another column if a target cell does not contain the specified text ("apples"), then do one of the following. If you are looking for the opposite result, i.e. For this, we are going to use a simple IF formula that checks for non-blank cells.įor example, to find out if cell A2 contains "apples", use this formula: Return different results based on cell valueįor starters, let's see how to find cells that contain anything at all: any text, number, or date.If cell contains several strings (AND logic).If cell contains one of many text strings (OR logic).If cell contains certain text string (partial match).If cell contains specific text (exact match).The below examples cover the most frequent scenarios. Generally, you will use the IF function to do a logical test, and return one value when the condition is met (cell contains) and/or another value when the condition is not met (cell does not contain). There exist several variations of "If cell contains" formula in Excel, depending on exactly what values you want to find.

What kind of value can that be? Just any text or number, specific text, or any value at all (not empty cell). One of the most common tasks in Excel is checking whether a cell contains a value of interest. The tutorial provides a number of "Excel if contains" formula examples that show how to return something in another column if a target cell contains a required value, how to search with partial match and test multiple criteria with OR as well as AND logic.
