Check for any match between three ranges but ignore zeros

Louis chiron

New Member
Joined
Mar 10, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi, I'm looking for some help on this one.

I have a sheet with three ranges of random values. I need to compare the values in each range and check whether any value (other than zero) is present in all three ranges.
I don't need to know what the matching value is, or how many matches there may be, just that a match does exist.

1710065917277.png


In the example above, 32 appears in each range so I would like the formula to return a TRUE.
Zero also appears in each range but I don't want the formula to search for matching zero's so, if 32 wasn't present, it would be returning FALSE.

I managed to get it to work with the first two ranges using:
SUMPRODUCT(COUNTIF(A2:A7,B2:B7))

...but that wont work with three ranges, and it didn't ignore any matching zeros.

Is there a way to do this?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Welcome to the MrExcel board!

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also, I suggest that you investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with.

Is it possible that the same non-zero value can occur more than once in a single column? For example, with your sample data, would it be possible for B6 to be 32 as well as B4?
 
Upvote 0
Book3
ABC
1Customer IDYearValue
2AA1201932
3AA1201978
4AA120190
5AA1202065
6AA1202032
7AA120205
8AA120205
9AA120219
10AA1202132
11AA1202156
12AA2201912
13AA220197
14AA220207
15AA220205
16AA2202165
17AA220210
18AA3201926
19AA320190
20AA320200
21AA320209
22AA320209
23AA3202154
24AA3202126
25AA320219
26AA320210
Sheet1


Apologies, I've now updated my profile and installed XL2BB.
The sheet here shows the actual structure of my sheet - i refined it in my original post to avoid confusion. As you can see the three ranges of values are all sat in the same column.

I will already know the range address for each range i need to search through ( e.g. AA1's ranges are B2:B4, B6:B8 and B9:B11) so don't need to find these.

Column A is the unique customer ID. Each customer will have a range of values split into three years (Column B). Column C are the values for those years. The number of values in each year range will vary (e.g. customer AA1 has 3 values for 2019, but AA2 has 2 values).
For each customer on my list (approx. 20k customers), I am wanting to search for a match in the three 'year' ranges for each customer.
In my example customer AA1 has a match across the three years, but AA2 doesn't. AA3 has only a match on '0' but i dont want to ID any matching '0's.
It is possible for the same value to appear in each year range (e.g. '9' in AA3 2020)
 
Upvote 0
Not sure if i can edit a post but i should ask that the results i'd be looking for would be:

AA1 TRUE
AA2 FALSE
AA3 FALSE
 
Last edited by a moderator:
Upvote 0
EDIT: "I will already know the range address for each range i need to search through ( e.g. AA1's ranges are C2:C4, C6:C8 and C9:C11) so don't need to find these."
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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