Probably a better way, but my mind is struggling a bit tonight to find
something shorter, so.....
If your data is in A1:E3 enter this *array* formula is entered in H1 (using
Cntrl+Shift+Enter), then copy across until you get #NUM error.
=SMALL(IF(FREQUENCY(SMALL($A$1:$E$3,ROW(INDIRECT("1:15"))),SMALL($A$1:$E$3,ROW(INDIRECT("1:15"))))>0,SMALL($A$1:$E$3,ROW(INDIRECT("1:15"))),""),COLUMN()-COLUMN($H1)+1)
change range and cell references where needed. If the size of your range
varies (ie has more or less than 15 cells), change INDIRECT("1:15") to
INDIRECT("1:"&COUNT($A$1:$E$1)).
If you'd rather the cells be "" instead of #NUM then try:
=IF(COLUMNS($H1:H1)<=SUMPRODUCT(($A$1:$E$3<>"")/COUNTIF($A$1:$E$3,$A$1:$E$3&"")),SMALL(IF(FREQUENCY(SMALL($A$1:$E$3,ROW(INDIRECT("1:15"))),SMALL($A$1:$E$3,ROW(INDIRECT("1:15"))))>0,SMALL($A$1:$E$3,ROW(INDIRECT("1:15"))),""),COLUMN()-COLUMN($H$1)+1),"")
If your data can have blank cells in it, then try:
=IF(COLUMNS($H1:H1)<=SUMPRODUCT(($A$1:$E$3<>"")/COUNTIF($A$1:$E$3,$A$1:$E$3&"")),SMALL(IF(FREQUENCY(SMALL($A$1:$E$3,ROW(INDIRECT("1:"&COUNT($A$1:$E$3)))),SMALL($A$1:$E$3,ROW(INDIRECT("1:"&COUNT($A$1:$E$3)))))>0,SMALL($A$1:$E$3,ROW(INDIRECT("1:"&COUNT($A$1:$E$3)))),""),COLUMN()-COLUMN($H$1)+1),"")