Here is a formula challenge for you.
![How many values are common in 2 lists [homework] How many values are common in 2 lists [homework]](https://img.chandoo.org/hw/formula-size-of-common-values-in-2-lists.png)
Lets say we have 2 lists of values in A1:A10 & B1:B10
Now, how do you find the number of common values in both lists?
We just want the count, not list of common values it self.
Go ahead and figure out the formula and post your answers here.
Bonus challenges:
- Write the formula if 2 lists have non-numeric values (text for example) ?
- Write the formula if 2 lists are not of same size (A1:A10 and B1:B15 for example) ?
- Write the formula if we have 3 lists (all same size, numeric values) ?
Go ahead and share your answers. I am eager to see what you will come up with.
PS: For some inspiration, check out this forum discussion.
PPS: If you just want to highlight the common values, see this.














One Response to “How to compare two Excel sheets using VLOOKUP? [FREE Template]”
Maybe I missed it, but this method doesn't include data from James that isn't contained in Sara's data.
I added a new sheet, and named the ranges for Sara and James.
Maybe something like:
B2: =SORT(UNIQUE(VSTACK(SaraCust, JamesCust)))
C2: =XLOOKUP(B2#,SaraCust,SaraPaid,"Missing")
D2: =XLOOKUP(B2#,JamesCust, JamesPaid,"Missing")
E2: =IF(ISERROR(C2#+D2#),"Missing",IF(C2#=D2#,"Yes","No"))
Then we can still do similar conditional formatting. But this will pull in data missing from Sara's sheet as well.