Import deal with associated contacts

I would like to be able to import deals from a spreadsheet that has associated accounts and/or contacts. This topic seemed to be on the right track but I need assistance in determining the correct formula for the automation, assuming one cannot import accounts along with the rest of the deal info. thanks,

reference: How to Import CRM data with automatical filling of related columns (company/contacts/deals)