Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88854

Check if Two Values Share a Row Anywhere on an Entire Sheet in Excel

$
0
0

I need to return a Boolean (or count) if two values share 1 row (or more) on an entire page.

The two values could be in any order on that row. They are not neatly organized in static, predictable columns.

So if we have cells containing:

abc 111 ghi 
ghi 222 abc 
jlk 333 xyz

I want it to return "true" (or 2, since there are 2 shared rows) when I check for "abc AND ghi". Similarly, a check for "jlk AND xyz" would return 1/true.

But if I was to check for "111 and 222" it would return 0/False, because they do not share a row.

I've found good support for sumproduct() and countifs() methods to do this, but the techniques were difficult to adapt to an entire page that does not have information organized in predictable columns.


Viewing all articles
Browse latest Browse all 88854


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>