Try this:
Assume the range is A1:B10 and there are no empty cells within the range.
Enter this formula** in C1. This will return the count of numbers that meet
the criteria.
=SUMPRODUCT(--(ISNA(MATCH(A1:A10,B1:B10,0))))
Enter this array formula** in D1 and copy down until you get blanks. This
will extract the numbers that meet the criteria.
=IF(ROWS(D$1
1)<=C$1,INDEX(A$1:A$10,SMALL(IF(ISNA(MATCH(A$1:A$10,B$1:B$10,0)),ROW(A$1:A$10)-MIN(ROW(A$1:A$10))+1),ROWS(D$1
1))),"")
Or, you could combine both formulas into a single array formula** :
=IF(ROWS(D$1
1)<=SUM(--(ISNA(MATCH(A$1:A$10,B$1:B$10,0)))),INDEX(A$1:A$10,SMALL(IF(ISNA(MATCH(A$1:A$10,B$1:B$10,0)),ROW(A$1:A$10)-MIN(ROW(A$1:A$10))+1),ROWS(D$1
1))),"")
** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)