Add data into new column based on column header of a second table

Hi,

I have two tables.

Table one has a column containing “Work Package Numbers”.

The second table has a number of columns, one for each Project Name. Under the Project Name there are all the “Work Package Numbers” related to each project.

What I would like to do is look down each Project Column in the 2nd Table in turn and where a Work Package number = to a Work Package number in the 1st table to then add the Project Name in a new column to the 1st Table.

At the moment i am using the Reference Row Filter on the 2nd table to do this one Project at a time but this means I end up with many workflow tables rather than a single table which i think would cut down on complexity

Any pointers would be welcome