If two word phrase exists in cell, then "1"

noslenwerd

Board Regular
Joined
Nov 12, 2019
Messages
85
Office Version
  1. 365
Hello,

In the example below, in cell c2, I am trying to search for "Red Apple" (C1), in the cell A3. If it is found, I want C3 to populate with a 1. If it is not, show a 0. As you can see below, it isn't working currently.

Any ideas what is wrong with my formula?

1639418443389.png
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
You need to swap the ranges round in the Search function. The 1st reference should be what you want to find.
 
Upvote 0
You have your ranges backwards. Try:
Excel Formula:
=IF(ISNUMBER(SEARCH(C$1,$A3)),1,0)

Note if you use the "$" like I did in my formula, you will be able to copy that formula to ALL other cells in your grid, and it will adjust correctly.
 
Upvote 0
And since you have Excel 365, you can write your formula in such a way that you don't need to copy the formula to any other cells. Just put this in B2, and the results will SPILL to the rest of the range:

Book1
ABCD
1DataYellow BananaRed AppleGreen Apple
2Yellow Banana, Red Apple110
3Red Apple, Green Apple011
4Yellow Apple, Yellow Watermelon000
Sheet11
Cell Formulas
RangeFormula
B2:D4B2=ISNUMBER(SEARCH(B1:D1,A2:A4))+0
Dynamic array formulas.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

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