Find cells which start (not contain) search strings

ellison

Active Member
Joined
Aug 1, 2012
Messages
343
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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,215,079
Messages
6,122,998
Members
449,092
Latest member
masterms

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