Meet a criteria over a range, then perform VLOOKUP

I have two tabs of data that I am trying to summarize on the first tab. Tab 1 contains a list of Project ID's, Project Name etc like so.

A             B                  C
Project ID    ProjectTitle       Project Code
1             Generic Project1   123
2             Generic Project2   456
3             Generic Project3   789

My second tab contains Project ID's and their corresponding business ID. The issue I have is, due to how the data has been supplied, a Project ID can appear multiple times, but only once with a Business ID, like so :

A            B
ProjectID    Business ID 
1             
1            
1
1            123456
2            789123
2
2
3
3            456789

I want to pull through the business ID for each ProjectID in Tab 1. THe logic I want to apply is, IF BusinessID IS NOT NULL, return the ProjectID. I have tried the following formula but hitting a SPILL error and I cannot think of another way to approach. Any advice greatly appreciated!

=IF(TAB2!B2:B100<>"0",VLOOKUP(C2,TAB2!$A$2:$B$100,2,FALSE),"")    

Solution 1:

You can try:

=LET(arrayProj,FILTER(G2:G10,H2:H10<>""),arrayBuss,FILTER(H2:H10,H2:H10<>""),INDEX(arrayBuss,MATCH(A2:A4,arrayProj,0)))

enter image description here