In Referral (key Record ID), there is a field called Referring Contact - which is a key for the table Contact.
In Activity (key Record ID), there is a field called Activity Contact - which is a key for the table Contact as well. It also has a field called Team Member ID - which is a key for the table Team Member.
The users want to know, for every Referring Contact in table Referral, the name of the Team Member who had an activity most recently with that Referring Contact.
The Activity table contains this information but I cannot figure out how to get it into the Referral table to report - I think the two tables should be related, then there should be a formula field that brings the (newest) Activity record, with its associated Team Member, into the Activity Record. But how to relate the two tables, since the "matching" Contact fields are not the key of either table?