Formula to search if text contains certain letters

Excel1991

Board Regular
Joined
Aug 1, 2018
Messages
58
Hi All,

I am helping build a spreadsheet for some teachers that will assist in reducing time it takes them to grade children's spelling. This is primarily related to children who do not speak english as a primary language.

I was trying to find a formula that basically does the following:
  1. Kids are asked to spell the word "shine"
  2. The formula needed would need to assess whether the word contains the letter "i" and the letter "e". The trick is that the letter "i" must come before the letter "e" for the kids to earn a point.
  3. As this is primarily designed for children learning English, it does not matter which letter(s) fall in between the "i" and the "e" as the lessons are teaching them how english letters work together with spelling being the secondary function. .
    1. For instance, if the child were to spell "shipe" instead of "shine", they would still receive a point for using the correct two letter (i and e)
Is it possible to use a formula to perform this task? I was thinking it would need to be a formula structured similar to something like this:

=IF(ISNUMBER(SEARCH(b1,a1)),1,0) where b1 is the letters im looking for ("i" followed by "e") and a1 is the actual word the child spelled.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Maybe something like this

Pasta1
ABC
1WordLettersResult
2shipei*e1
3shepii*e0
4siepi*e1
5shinei*e1
6shenii*e0
7iei*e1
Plan2
Cell Formulas
RangeFormula
C2:C7C2=IF(ISNUMBER(SEARCH(B2,A2)),1,0)


Observe the asterisk between the two letters - it means 0 or more characters

Hope this help

M.
 
Upvote 0
where are you going with this?
Is EVERY test searching for 2 letters in a specific order

Very similar to solution posted by @Marcelo Branco

In B2
i*e
In C2
=NOT(ISERROR(MATCH("*"&B1&"*",A1,0)))*1
 
Upvote 0
You're close: Just add the asterisks ("*") between the letters you're searching for and it should work.

The asterisk is a wildcard meaning "zero or more digits". Another wildcard symbol is the question mark. It is used to mark a single digit.
 
Upvote 0
Thank you all very much! Using the asterisk did the trick.

Nice to come across a neat little trick. Thank you again for your help
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,473
Members
448,967
Latest member
visheshkotha

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