Adapt formula for one of many choices

ChristineJ

Well-known Member
Joined
May 18, 2009
Messages
775
Office Version
  1. 365
Platform
  1. Windows
I use the following formula in cell D12 to return TRUE or FALSE based on whether an entry in cell B5 matches one of the choices in range D5:D9.

=SUMPRODUCT(--(B5=D5:D9))>0

As an example, the following colors appear in D5:D9:
D5 red
D6 green
D7 yellow
D8 blue
D9 white

If "white" (or an other color listed) s entered in cell B5, cell D12 returns TRUE. Anything other than these colors returns FALSE.

I'd like to adapt this so that if any of those colors appear in the string in cell B5, it will return TRUE. For example, all of these would return TRUE:

(1) a bluebird, (2) tall green tree, (3) yellow flower, (4) barred, (5) bright whiteness

No color will ever appear twice in the string, and only one color will every appear in the string.

Appreciate help with this! C
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top