Check if a cell is subset of another

newscientist_au

New Member
Joined
Feb 6, 2014
Messages
10
Hi all
I am wondering if you can help with with the following:
I would like to check if any of text strings in cells are subsets of another larger string in the same column. It may or may not be the whole contents of the cell
for example:
A1 ABCDEFG
A2 DGRHDN
A3 GYUTABCDE (This has part of A1 in this sequence)
A4 RHDNDHHY (This has part of A2 in its sequence)

If a match is found can we place, the larger sequence (in the adjacent column)?

Am I making sense? Please let me know if you need more info

Thanks heaps for helping out!
 
Last edited:

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
And in a case where a cell is a subset of more than 1 other cell, what happens?
 
Upvote 0
Hi,

Is there a lower limit on the size of the substring which can be considered a subset? Your two examples appear to match substrings of length 4 characters. But what if just a single letter of one string is found in another? Is that also considered a "match"? If so, then in your example, A1 should equally be marked up, as it shares a "D" with A2.

Regards
 
Upvote 0
Hi,

Is there a lower limit on the size of the substring which can be considered a subset? Your two examples appear to match substrings of length 4 characters. But what if just a single letter of one string is found in another? Is that also considered a "match"? If so, then in your example, A1 and A2 should equally be marked up, as they both contain a "D".

Regards
Hi that's a good point. The minimum length should be 6 matches. It would be great if I can manually edit this parameter case in case I find it is not performing well .
 
Upvote 0
"The minimum length should be 6 matches"

Bit confused. Like I said, in your two examples, you've marked up strings where the matching substring is only 4 characters long (?)

Regards

Edit: sorry, one is 5, the other 4.
 
Upvote 0
"The minimum length should be 6 matches"

Bit confused. Like I said, in your two examples, you've marked up strings where the matching substring is only 4 characters long (?)

Regards

Edit: sorry, one is 5, the other 4.

That's correct. I must apologise for the poor examples. However, it does reflect the sort of data that is in the set. I am only interested in strings that are 6 characters or longer.
 
Upvote 0
Just to have something to work with, could you please provide perhaps a dozen examples with your desired result - based on this new criterion - in each case?

Regards
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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