CONTAINS or other Function?

slam

Well-known Member
Joined
Sep 16, 2002
Messages
876
Office Version
  1. 365
  2. 2019
I'm trying to determine if any of the text in H2 is a match for the entire contents of D2, and if it is, display Yes, else display No. The problem with this formula is that D2 is usually just text in quotes and not a cell reference, so I'm not sure if it can be modified, or if I should be using something else.

=IF(CONTAINS(H2,D2,TRUE),"Yes","No")

Any help would be greatly appreciated!
 
Hi all, to clarify with an example:

D2: US36
H2: T1G.0191.51.8.5 (US03), 6300004210 (CH12), 6300004268 (CH05), 6300004212 (US36)

Result in this case should be "Yes" because "US36" is in H2.
Thanks.
That confirms what we thought, you are asking "does all of D2 exist anywhere in H2".
The formula vogateer gave you does exactly that, so you should be good!
 
Upvote 0

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,216,799
Messages
6,132,770
Members
449,760
Latest member
letonuslepus

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