@oeldere, thanks for the heads up, I uploaded a picture of a simplification of my data file, does that help? I want to output the column number where a 1 is listed within the matrix that corresponds to a given REF # (note: REF #s do not necessarily go in order so I need to be able to look up the row based on the REF # and then look up the column based on its matrix value)

~Charlie