Searching for partial, but only when it's its own word

oscark37

Board Regular
Joined
Nov 23, 2015
Messages
56
Let's say T12 = 'Novice Dec

=IF(ISNUMBER(SEARCH("nov",T12)),"5",IF(ISNUMBER(SEARCH("dec",T12)),"6",""))

With the above equation, it will return "5". I want it only to return "5" if "nov" is its own word. IE in this case, it want it to return "6".

Thanks for the help.

Oscar
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Try

=IF(ISNUMBER(SEARCH( " "&"nov"&" "," "&T12&" ")),"5",IF(ISNUMBER(SEARCH( " "&"dec"&" "," "&T12&" ")),"6",""))

M.
 
Upvote 0
Let's say T12 = 'Novice Dec

=IF(ISNUMBER(SEARCH("nov",T12)),"5",IF(ISNUMBER(SEARCH("dec",T12)),"6",""))

With the above equation, it will return "5". I want it only to return "5" if "nov" is its own word. IE in this case, it want it to return "6".
Will the cells you are searching (such as T12 in your example above) ever contain punctuation (commas, periods, dashes, parentheses, etc.) next to the words you search for or will those words always have a space next to them on either side (unless, of course, they are the first or last word in which case there would only be a space on one side of them)?
 
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

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