BenElliott
Board Regular
- Joined
- Jul 19, 2012
- Messages
- 144
I'm trying to compare two columns of numbers and extract the numbers that are common to both.
Cell A2 contains the number of filled cells in column 'A'. Column 'B' has list 2.
I can use the following to extract the numbers but it leaves blank cells in the resultant column 'C': =IF(ISERROR(MATCH(A5,$D$5:$D$200,0)),"",A5)
If I use the following:=IF(ROWS(A$5:A5)>$A$2,"",INDEX($D$5:$D$200,AGGREGATE(15,6,(ROW($B$5:$B$200)-ROW($B$5)+1)/ISNUMBER(MATCH($B$5:$B$200,$A$5:$A$200,0)),ROWS($E$5:E5)))) I get the first common value in every cell of column 'C'
My head is spinning. Where am I going wrong?
Thanks for your patience.
Ben
Cell A2 contains the number of filled cells in column 'A'. Column 'B' has list 2.
I can use the following to extract the numbers but it leaves blank cells in the resultant column 'C': =IF(ISERROR(MATCH(A5,$D$5:$D$200,0)),"",A5)
If I use the following:=IF(ROWS(A$5:A5)>$A$2,"",INDEX($D$5:$D$200,AGGREGATE(15,6,(ROW($B$5:$B$200)-ROW($B$5)+1)/ISNUMBER(MATCH($B$5:$B$200,$A$5:$A$200,0)),ROWS($E$5:E5)))) I get the first common value in every cell of column 'C'
My head is spinning. Where am I going wrong?
Thanks for your patience.
Ben