I found a formula online that works perfectly to count the number of matches between two ranges, but I have no idea how it works. Can someone who understands please explain? Thank you!
=SUMPRODUCT(--ISNUMBER(MATCH(Range1,Range2,0)))
I found a formula online that works perfectly to count the number of matches between two ranges, but I have no idea how it works. Can someone who understands please explain? Thank you!
=SUMPRODUCT(--ISNUMBER(MATCH(Range1,Range2,0)))
I will give it a shot.
Lets say the 2 ranges are 1,2,3,4,5,6 and 10,20,6,5,40,3,9,1.
The MATCH function will return{8,#N/A,6,#N/A,4,3}
ISNUMBER will return(TRUE,FALSE,TRUE,FALSE,TRUE,TRUE)
Double Negative converts to (1,0,1,0,1,1)
Final result = 4
You can also use this formula to get the same results
{=SUM(IF(ISERROR(MATCH(Range1,Range2,0)),0,1))}
Thanks garfield! I didn't know you could use double negative that way. Very clever.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks