I'm trying to convert a Google Sheets I downloaded to work with Excel.

It includes this a formula
Please Login or Register  to view this content.
Columns BN, BO, BP, and BQ contain formulas like
Please Login or Register  to view this content.
Since Excel doesn't include anything like this, I've written a VBA script that reads the URL and inserts the appropriate image into the cells and clears the formula. Now I'm trying to figure out how to make the first formula work. I would need it to copy the appropriate image from cells BN, BO, BP, or BQ depending on the value of BM. How can I do this in Excel?

Thanks.