More seriously, I would have suggested Power Query but you need Office 365 for the Mac for that, so the next stage is likely, unfortunately, to be VBA (macro).
I did come across this page which starts off with "This wikiHow teaches you how to use the Power Query feature in Excel 2016 on a Windows and Mac computer." but I'm not so sure:
How to Activate Power Query in Excel 2016: 9 Steps (with Pictures)
I don't have a Mac so can't advise with any certainty, but if you find you can then that's the way to go.