Lookup with if statement


Hey All!

Really hoping this can be solved!

I am building out a CRM in airtable, and I am wondering if this is possible.

So I have companies, and contacts. Contacts have a “type” i.e. primary, alternate, general etc.

There could be 20 contacts linked to a company record, but is there a way to do a lookup with an if statement(or rollup maybe?) that I can dynamically link to? Basically, I want a primary contact field on a company and have it look through all the Contacts and display the one that is the primary.