In G23 enter formula:
=IFERROR(INDEX(ATMS!$I$2:$I$4961, SMALL(IF(ATMS!$B$2:$B$4961=$A24, IF(ATMS!$O$2:$O$4961<>"", ROW(ATMS!I$2:I$4961)-MIN(ROW(ATMS!I$2:I$4961))+1)), COLUMNS($G23:G23))),"")
This formula needs to be confirmed with CTRL+SHIFT+ENTER not just ENTER.
Then copy it across and down the chart.
|