How To Add Flag Icons To Google Sheets Dynamically

This is a much easier way to do it now.
All you need it this code

=image("https://flagcdn.com/w160/" & lower(**codefield**) & ".png")

Just point codefield to you 2 letter country code and it works.

Sorry for the old way, was way too complicated.