anglais428
Well-known Member
- Joined
- Nov 23, 2009
- Messages
- 634
- Office Version
- 2016
- Platform
- Windows
I am looking for a formula to solve the following problem. Say I have a data range of A2:A6
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Cell (A1)[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]Manchester, UK | Chester, UK[/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD]Chester[/TD]
[/TR]
[TR]
[TD]A4[/TD]
[TD]Manchester, UK[/TD]
[/TR]
[TR]
[TD]A5[/TD]
[TD]Chesterfield, UK[/TD]
[/TR]
[TR]
[TD]A6[/TD]
[TD]Chester, UK[/TD]
[/TR]
</tbody>[/TABLE]
I would like for the result to be '3' as Chester is in A2, A3 and A6.
The problem I am having is when 'chester' is part of another word - I want it to exclude the likes of Manchester, UK and Chesterfield, UK.
So it is almost requiring an exact match within a partial string match.
Any help would be appreciated.
Either formula or VBA to solve the problem would be fine.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Cell (A1)[/TD]
[TD]Name[/TD]
[/TR]
[TR]
[TD]A2[/TD]
[TD]Manchester, UK | Chester, UK[/TD]
[/TR]
[TR]
[TD]A3[/TD]
[TD]Chester[/TD]
[/TR]
[TR]
[TD]A4[/TD]
[TD]Manchester, UK[/TD]
[/TR]
[TR]
[TD]A5[/TD]
[TD]Chesterfield, UK[/TD]
[/TR]
[TR]
[TD]A6[/TD]
[TD]Chester, UK[/TD]
[/TR]
</tbody>[/TABLE]
I would like for the result to be '3' as Chester is in A2, A3 and A6.
The problem I am having is when 'chester' is part of another word - I want it to exclude the likes of Manchester, UK and Chesterfield, UK.
So it is almost requiring an exact match within a partial string match.
Any help would be appreciated.
Either formula or VBA to solve the problem would be fine.