EDIT (Updated following solutions suggested)
I need to count the number of duplicates between two rows (in one formula) :
Row 1> 20 21 22 41
Row 2> 3 20 30 22 47 49
Here the result should be 2 (20 & 22)
The two following formulas are working :
=COUNT(FILTER(UNIQUE(flatten(TRANSPOSE(A2:F3))), ARRAYFORMULA( COUNTIF(flatten(TRANSPOSE(A2:F3)),UNIQUE(flatten(TRANSPOSE(A2:F3))))>1 )))
and
=countif(query(flatten(A2:F), "Select count(Col1) group by Col1"), ">1")
But as soon as the two rows are not in the same sheet the formula doesn't work anymore (even with bracket)
Here is a Google Sheet with sample data and result : https://docs.google.com/spreadsheets/d/1PRNGgzAmpQUE0nCCuxBPJbM4gESUtnSMQf-cXG3ozBo/edit?usp=sharing
What do you think ?
Thank you !
COUNTIF
probably didn't work because you'd need to transpose those values first, e.g.:=SUMPRODUCT(COUNTIF(1:1,TRANSPOSE(2:2)))
. Also, since it's an array formula you'd either needARRAYFORMULA
orSUMPRODUCT
. Also, if an answer below suited your needs, consider to upvote/accept it as such. Off-topic, you might want to revisit most of your former questions and see if there are answers for you to accept and therefor close those questions. – JvdV=COUNT(FILTER(UNIQUE(flatten({A2:F2;Sheet1!A22:F22})), ARRAYFORMULA( COUNTIF(flatten({A2:F2;Sheet1!A22:F22}),UNIQUE(flatten({A2:F2;Sheet1!A22:F22})))>1 )))
– marikamitsos