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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
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,213,546
Messages
6,114,256
Members
448,557
Latest member
richa mishra

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