Forum Discussion
Deleted
Aug 02, 2019If cells equal then next returns
Hello, Could someone help me with a formula to produce the below: - If cell A1 has the word “apple” - and then cell B1 has the word “orange” - return the word “fruit” in cell C1 Thanks
- Aug 02, 2019
Deleted this formula in C1 should work
=IF(AND(B1="orange",A1="apple"),"fruit","not fruit")
PeterBartholomew1
Aug 02, 2019Silver Contributor
Another formula:
= AND( COUNTIFS( products, {"*apple*";"*orange*"} ) )
This tests whether "apple" is to be found in either cell, returning 0, 1, or 2. Then it tests the second element of the array constant to determine whether "orange" is to be found in neither, one or both, again giving 0, 1, or 2. The AND only returns TRUE if neither element of the resulting array is zero.
A byproduct of such an approach is that
| orange juice | pineapple |
returns true irrespective of their order.