Tab 1 looks like this: |ID|CODE|VALUE |------|---|---- |100010|309|34 |100010|312|34 |100010|392|17 |100010|394|0.31 |100020|309|34 |100020|312|62 |100020|392|0.25 |100020|400|23
Tab 2 looks like |ID|309|312|392|394|401|404| |------|---|---|---|---|---|---| |100010| |100020|
I want to transpose the values from Tab 1 into Tab 2, by appropriate code and ID. Also note that occasionally individual IDs will use different sets of codes, though largely the same (see 10010 code 394 vs 100020 code 400 - these are the 5th and 9th rows of Tab 1).
I've tried a bunch of different methods like QUERY, FILTER, ARRAY, TRANSPOSE, but I can't quite get the right syntax.
One of my rudimentary attempts: =QUERY(tab1!B:B,"select * where A contains '"& 1W &"',TRANSPOSE(tab1!D:D)) and A is not null", 0)
Thanks for you help!
Edit: I added a screen cap of the tables just incase the markdown isn't showing correctly.

