SUMPRODUCT: Having a dynamic range of cells to search for

samgil

New Member
Joined
Apr 20, 2017
Messages
19
Hi Gang,

I want to change this:

=SUMPRODUCT(--ISNUMBER(SEARCH({"A1","A2","A3"},C1)))>0

to be a range like A1:A10 instead of "a1", "a2", "a3". However, if none of the cells in the range A1:A10 match C1, yet are empty, it will still return TRUE for some reason.

 
[TABLE="class: grid"]
<tbody>[TR]
[TD]Row\Col[/TD]
[TD]
A​
[/TD]
[TD]
B​
[/TD]
[TD]
C​
[/TD]
[/TR]
[TR]
[TD]
1​
[/TD]
[TD]reds[/TD]
[TD][/TD]
[TD]red[/TD]
[/TR]
[TR]
[TD]
2​
[/TD]
[TD]red[/TD]
[TD][/TD]
[TD]
TRUE​
[/TD]
[/TR]
[TR]
[TD]
3​
[/TD]
[TD]blue[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
4​
[/TD]
[TD]blue[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
5​
[/TD]
[TD]blue[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
6​
[/TD]
[TD]blue[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
7​
[/TD]
[TD]blue[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
8​
[/TD]
[TD]blue[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
9​
[/TD]
[TD]blue[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
10​
[/TD]
[TD]blue[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


In C1 enter:

=ISNUMBER(LOOKUP(9.99999999999999E+307,SEARCH(" "&C1&" "," "&$A$1:$A$10&" ")))

If your system fails to deliver TRUE in C2, what happens? Error, a wrong result?

That use case returns TRUE. I am still looking for one that returns TRUE if you were to delete A2 "red".
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
That use case returns TRUE. I am still looking for one that returns TRUE if you were to delete A2 "red".

It looks like you are changing your requirements: A2 is deleted; C1 specifies red; you want the formula to deliver TRUE, right? If so, is it because C1 partially match reds in A1?
 
Upvote 0
It looks like you are changing your requirements: A2 is deleted; C1 specifies red; you want the formula to deliver TRUE, right? If so, is it because C1 partially match reds in A1?


Yep because C1 partially matches reds in A1. Apologies for the confusion, my initial question was answered (exact match), so I'd then asked for a partial match version in the 5th post.
 
Upvote 0
Yep because C1 partially matches reds in A1. Apologies for the confusion, my initial question was answered (exact match), so I'd then asked for a partial match version in the 5th post.

For non-partial match (case-insensitive exact match)...

=ISNUMBER(LOOKUP(9.99999999999999E+307,SEARCH(" "&C1&" "," "&$A$1:$A$10&" ")))

For case insensitive partial match, i.e. your current request...

=ISNUMBER(LOOKUP(9.99999999999999E+307,SEARCH(" "&C1," "&$A$1:$A$10)))
 
Upvote 0

Forum statistics

Threads
1,223,727
Messages
6,174,146
Members
452,547
Latest member
Schilling

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