Search for various text in a row and add text to a different field

SallyN

New Member
Joined
Jun 3, 2015
Messages
6
Hi all, I've just signed up because I am really struggling with this Excel challenge (I am running XLS 2013).
I have various contacts in a list, and per contact I have one field which shows me, what this contact has bought from me. (in only one field, can be multiple content, as in "supplier1", "supplier2", "supplier3")

I want to find a way, where I can search in this field and say yes or no in a different field, depending whether the content contains some elements I am searching for. I tried to separate the these comma-separated contents into several columns, but I still can't find a way where I can mark another field if only some content is true.

For example:

Column A (Bought from me)
1 "Icecream", "Jeans", "Shoes"
2 "Icecream", "Trousers", "Shoes", 3 "Socks"
4 "Jacket"
5 "Shoes", "Socks", "Cards"

<colgroup><col></colgroup><tbody>
</tbody>

I want Column B to say yes or no. Yes, when A includes either Icecream or Cards or Shoes. And No, if none of these are existing.

Could you please help me out?
Really can't wait to see suggestions as I am searching since days for a solution...
THANKS so much in advance for your help.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Place this formula in B2

=IF(ISERROR(FIND("Icecream",A2,1)),IF(ISERROR(FIND("Cards",A2,1)),IF(ISERROR(FIND("Shoes",A2,1)),"NO","YES"),"YES"),"YES")


You could use various finds by changing the "Icecream" to a cell Reference and typying the "Icecream" in that cell when you change that cell it would look for that word instead.

Example:
C1 =Icecream
C2 =Cards
C3 = Shoes
then use this formula
=IF(ISERROR(FIND($C$1,A2,1)),IF(ISERROR(FIND($C$2,A2,1)),IF(ISERROR(FIND($C$3,A2,1)),"NO","YES"),"YES"),"YES")
 
Upvote 0
Try this slightly shorter version...
=IF(SUM(COUNTIF(A2,{"*Icecream*","*Cards*","*Shoes*"}))>0,"Yes","No")
 
Upvote 0
:biggrin::biggrin: This is probably the best help I've ever had, thank you sososososo much! It works perfectly and it is so easy to adapt it to more products. Huge help, thanks!!!!
Try this slightly shorter version...
=IF(SUM(COUNTIF(A2,{"*Icecream*","*Cards*","*Shoes*"}))>0,"Yes","No")
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

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