String "TEMAN" is not recognized in namedrange for SEARCH command?

dellzy

Board Regular
Joined
Apr 24, 2013
Messages
146
Hi Excel Experts,

I came across very weird situation here. Hopefully, somebody can give me solution. I'm trying to create a formula that will search the string(s) in a namedrange and return "Yes" if one of them matches in the sentence of the referred cell and return "" if no match. However, I really don't understand, when it comes to the string "Teman" in the sentence, it will return "" although "Teman" has already been added in the namedrange. Is there something wrong with my formula?

Example:-

namedrange: IncludeMe
Teman
You
sorry

SentenceFormulaOutput
You have deleted the number in your 8PAX list.IF(SUMPRODUCT(--ISNUMBER(SEARCH(Include,$A2)))>0,"Yes","")Yes
You have deleted the number in your TEMAN list.IF(SUMPRODUCT(--ISNUMBER(SEARCH(Include,$A3)))>0,"Yes","")
Sorry, you have reached the limit in your TEMAN list.IF(SUMPRODUCT(--ISNUMBER(SEARCH(Include,$A4)))>0,"Yes","")
Sorry, you have reached the limit in your FRIEND's list.IF(SUMPRODUCT(--ISNUMBER(SEARCH(Include,$A5)))>0,"Yes","")Yes

<tbody>
</tbody>

FYI, when I tested with static string "Teman" in the formula, then it will return the value "Yes" as expected.
eg. IF(ISNUMBER(SEARCH("Teman",$A5))=TRUE,"Yes","").
However, I want to keep it neat in a namedrange because the strings for search is expected to grow up to 100 and the formula needs to run across more than 10k rows of variety of sentences. Also, am not sure if it's only gonna be only "Teman" which gives this type of unexplained result, so, setting a static string each time for each of this similar issue can be very messy.

Appreciate your expertise.

Thank you in advance.
DZ
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I've tested your formula, and it seems to work fine for me. 2 thoughts: Your named range is IncludeMe, but in the formula, you use Include. Second, if your named range has empty cells, then your formula will match anything. Either fill empty cells with xxxxxx (or something), or make it dynamic so there are no empty cells to check. Also, with "you" in your named range, it should return yes for all of your examples.

Hope this helps.
 
Last edited:
Upvote 0
what range is the named range "Include"?

is this multiple cells or a single cell?

if search returns 0 then it simply is not there in the referenced range... not sure if things break if Include is referencing multiple cells and maybe you only refer to the first cell in the range if you dont set it up as an array formula
 
Upvote 0
In B5 enter and copy down:
Rich (BB code):
=IF(ISNUMBER(LOOKUP(9.99999999999999E+307,
    SEARCH(" "&Include&" "," "&TRIM(SUBSTITUTE($A5,","," "))&" "))),"yes","no")
<strike></strike>
 
Upvote 0
Cross-posted: Search string "TEMAN" in namedrange but return blank?

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule #13 here: Forum Rules).

This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.

For a more complete explanation on cross-posting, see here: Excelguru Help Site - A message to forum cross posters).
 
Upvote 0
Hi Aladin Akyurek,

Thank you for your formula. However, it has only resolve the one with the "TEMAN" word but it has affected others to be returned as "no". I finally found my culprit.

My latest formula was like this :
=IF(AND(SUMPRODUCT(--ISNUMBER(SEARCH(Include,$A2)))>0,SUMPRODUCT(--ISNUMBER(FIND(Exclude,$A2)))=0),"MT","")

My culprit was that, in the namedrange Exclude, there is a string "EMA", which is part of the word "TEMAN", so that's why it return blank. So, I had to put a space after the word "EMA" becoming "EMA " to allow the formula to identify as 2 different strings and will return "Yes".
*phewwww* had spent 3 days thinking what went wrong and the solution is just a space.. lol!

However, thanks a lot for all those who contributed.

DZ
 
Upvote 0
Hi Aladin Akyurek,

Thank you for your formula. However, it has only resolve the one with the "TEMAN" word but it has affected others to be returned as "no". I finally found my culprit.

My latest formula was like this :
=IF(AND(SUMPRODUCT(--ISNUMBER(SEARCH(Include,$A2)))>0,SUMPRODUCT(--ISNUMBER(FIND(Exclude,$A2)))=0),"MT","")

My culprit was that, in the namedrange Exclude, there is a string "EMA", which is part of the word "TEMAN", so that's why it return blank. So, I had to put a space after the word "EMA" becoming "EMA " to allow the formula to identify as 2 different strings and will return "Yes".
*phewwww* had spent 3 days thinking what went wrong and the solution is just a space.. lol!

However, thanks a lot for all those who contributed.

DZ

Care to post the contents of Include and Exclude? And the contents of A2?
 
Upvote 0
Sure Aladin Akyurek. Kinda long list though..

Include:-
Teman
U
anda
tidak
enjoy
Please
Ur
free
welcome
Yr
Tempoh
Own
only
subscribe
thank
terima kasih
tahniah
percuma
frenz
family
suara
video
panggilan
pggln
sorry
sila
hanya
senarai
maaf
frenz
calls
best
didaftarkan
details
that
visit
You
Kawan
List
untuk

<tbody>
</tbody>

Exclude:-
BSS
NGIN
Kenan
EMA
QNS
null
VW
SIF
Not
FRENZSMS
${
,,
]:
\/
_outgoing
|
==
cgi?
errcode
()
OLNOS
smart2
sql
test
timeout
http://10.1
PORTOUT
UCP28882

<tbody>
</tbody>


$A2 : UBAHMIGYESS:$msg="Caj RM5 akan ditolak dr akaun anda utk beralih ke pelan Xpax Baru. Bonus & 8pax/15pax/Teman20 tidak terdpt dlm pelan ini.Htr MIG YES ke 28882 utk teruskan" if $language eq '2';


Thanks.
DZ
 
Upvote 0
Sure Aladin Akyurek. Kinda long list though..
[...]

Thanks for the lists. Just to make sure:

=IF(AND(SUMPRODUCT(--ISNUMBER(SEARCH(Include,$A2)))>0,SUMPRODUCT(--ISNUMBER(FIND(Exclude,$A2)))=0),"MT","")

will invariably return a blank when A2 contains TEMAN (from Include) and NGIN (from Exclude). Is this result what you are after?
 
Upvote 0

Forum statistics

Threads
1,214,901
Messages
6,122,157
Members
449,068
Latest member
shiz11713

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