Try this formulae approach
1/. Your Records are stored as Text and in some cases preceded with an apostrophe, clean this up first.
In this workbook I have removed all the apostrophes and converted the remainder to numbers
The column is formatted Number Format > Custom Type:= 0000000000
2/. Create a dynamic named range to keep the calculations to an absolute minimum
Name:= Record
Refers to:=
Formula:
='Sample Sheet'!$C$2:$C$2:INDEX('Sample Sheet'!$C:$C,MATCH(99^99,'Sample Sheet'!$C:$C,1))
3/. Remove duplicates with ths array formula, confirm with Ctrl+Shift+Enter before dragging Down until blanks are returned.
In A2
Formula:
=IFERROR(INDEX(Record,MATCH(0,COUNTIF($A$1:A1,Record),0),0),"")
4/. In B2 this array formula, again confirm with Ctrl+Shift+Enter before dragging Across and Down until blanks are returned.
Formula:
=IFERROR(INDEX('Sample Sheet'!$L:$L,SMALL(INDEX(IF(Record=$A2,ROW(Record),""),,1),COLUMNS($B:B))),"")
This will be heavy on very large worksheets, VBa will be faster.
Your Profile is 2007 but the workbook provided is 2003 or earlier this works with 2003, the description above gives the shorter 2007 formulae.
Bookmarks