Find cells which start (not contain) search strings

ellison

Active Member
Joined
Aug 1, 2012
Messages
356
Office Version
  1. 365
Platform
  1. Windows
Hi, we have some excellent code which allows us to search for if cells "contain" various search strings.

We are wondering if it would be possible to tweak it so that it would only show results where the cell "starts with" as opposed to contains.

(And hopefully deal with upper or lower case & blank cells)

Finding-Vocab-In-Cells-contains-OR-starts.xlsx
ABCD
1RowInfoResult Of Current FormulaGoal of a new formula which only does "begins with"
22alphavocab-reviewvocab-review
33Not alphavocab-review
44charlievocab-reviewvocab-review
55No longer charlievocab-review
66delta 
77 
88ECHOvocab-reviewvocab-review
99_echovocab-review
Sheet2
Cell Formulas
RangeFormula
C2:C9C2=IF(COUNT(SEARCH({"alpha","beta","charlie","echo"},B2)),"vocab-review","")


Any help hugely appreciated!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I am sure someone will come up with a better option but this seems to work.
Excel Formula:
=IF(SUM(COUNTIFS(B2,{"alpha","beta","charlie","echo"} & "*"))=1,"vocab_review","")
 
Upvote 0
Solution
same idea

=IF(SUM(COUNTIFS(B2,{"alpha","beta","charlie","echo"})),"vocab_review","")
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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