Search formula

lapta301

Well-known Member
Joined
Nov 12, 2004
Messages
1,001
Office Version
  1. 365
Platform
  1. Windows
Sorry to bother you but I need a bit of help in adjusting the following formula.


=IF(COUNT(SEARCH("*"&"AB"&"*"," "&$H2&" "))>0,"Bristol","")


At present it is looking for the letters AB in whatever string is in H2 and placing Bristol in the cell if successful.

What I now need to achieve is for the search in H2 to find either AB or CO or C0 and if found insert Bristol

As ever I hope this makes sense and my thanks for your help.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Give this a try...

=IF(COUNT(SEARCH("*"&{"AB","CO"}&"*"," "&$H2&" "))>0,"Bristol","")
 
Upvote 0
Rick

What can I say.

You've come up trumps again it works perfectly and adds a lot of flexibility for future use of which I am sure I will need.

My sincere thanks for taking the time.

Regards from a gloomy Southern England.
 
Upvote 0

Forum statistics

Threads
1,215,766
Messages
6,126,754
Members
449,336
Latest member
p17tootie

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