Ooops! My mistake.
The array formula on Sheet2, cell B2, should be this:
=SMALL(IF(COUNTIF(Sheet1!$A$1:$A$21,$A$2:$A$21)=0,$A$2:$A$21),ROWS(B$2:B2))
Commit that formula with CTRL+SHIFT+ENTER, instead of just ENTER.
Copy B2 into B3 and down through B21
The dynamic range name wagonnumbers automatically resizes to only allow unused numbers by using this formula as its reference:
=OFFSET(Sheet2!$B$2,,,COUNT(Sheet2!$B$2:$B$21),1)
Debra Dalgleish covers dynamic range names at her website:
http://www.contextures.com/xlNames01.html#Dynamic
I hope that helps
Bookmarks