Search for two values appearing in a cell at the same time

jdunbarjr

New Member
Joined
Dec 20, 2017
Messages
5
I am trying to search two columns of values (column I and J) where both appear at the same time in the same string/cell in column H. Let' say value (I11) and (J11) appear at the same time in column H cell (H11), and if yes/true, provides the H11 value in column W cell (W11). I have tried several formulas and cannot figure it out. For example:
Code:
=IF(OR(ISNUMBER(SEARCH("*I11*",`CBS SHEET1'!F:F)),ISNUMBER(SEARCH("*J11*",`CBS SHEET1'!F:F))),"1","-")
.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
"where both appear at the same time"
Then why are you using OR? It should be AND.

"in column H"
Then why are you searching column F ?

Will I11 and J11 only occur once in column H ?
 
Last edited:
Upvote 0
Yeah, I am sure that I am doing it wrong. I am trying to take the values from let's say cell I11 and J11 and see if they both appear in the same string/cell anywhere in column F, and if yes, then I would like that value from column F (that has both I11 and J11 values) to show up in column W. For example: if cell I11 = "cat", cell J11 = "dog", and some cell (perhaps F20) in column F = "cat.dog", then I would like in cell W11 to show "cat.dog". I hope this makes more sense.
 
Upvote 0
Hi,

What if F is "dog.cat", is that considered a match?
Also, is "cat.dog.other" a match?

And are the values in F all delimited by a period ( . ) or something else?
 
Last edited:
Upvote 0
Yes, as long as both I11 and J11 are within the same cell anywhere in column F .. it would be considered a match, even if there is other data within that cell too.
 
Upvote 0
Then this should do what you described:


Book1
FGHIJW
11cat.mousecatdogsome dog and some cat
12
13dog bone
14
15cat litter
16
17food dog
18
19
20some dog and some cat
21food cat
Sheet539
Cell Formulas
RangeFormula
W11=IFERROR(IFERROR(LOOKUP(2,1/SEARCH(I11&"*"&J11,F11:F21),F11:F21),LOOKUP(2,1/SEARCH(J11&"*"&I11,F11:F21),F11:F21)),"No Match")
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

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