Testing if 2 arrays include same value

fatduck

New Member
Joined
Jun 26, 2008
Messages
13
Hi there
I have 2 arrays, and I need to test whether any of the values in array A (cells A2:A7) occur in array B (Column H:H on a different worksheet). All I need to return is a basic "yes" or "no", but I'd rather a neat way of doing this rather than doing 5 separate lookups for each of the array A values.
If anyone has any advice I'd be very grateful!
Thanks!
Daniel
 
I would probably run a Find() against the column H of the other sheet suing the values in the first range in the What: argument. Find is optimised for searching ranges so should be reasonably efficient.
 
Upvote 0
This works too.
Code:
=SUMPRODUCT(COUNTIF(Sheet2!H:H,A1:A8))>0
Regards
Northwolves
 
Upvote 0

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