Traditionally, people have inserted pictures or Logos in an Excel worksheet. Unfortunately, the method used is tedious and does not provide any dynamic change for the picture (i.e., the picture is static). One would have to replace the picture manually and resize it again to make it fit once more.
Imagine a circumstance where you would want a picture or a logo to change on demand. For example, based on a value entered in a cell (or calculated value in a cell), you want the picture to change automatically.
Scenario:
In our example, a person enters a number in a cell (D3), and the picture at the top of the worksheet needs to change automatically. The example shows only 5 numbers associated with 5 pictures, but this situation could easily be a larger number, like a team of people. While the feature in this example is mainly to show the ability to Insert a Picture in a Cell directly, the lookup and automation is performed using a VLOOKUP function (taught in Excel Level 2 at L&OD).
Picture Automation using the VLOOKUP Function:
- Convert the range of Numbers & the Picture cells (F5:G10) into a Table (CatTable)
- In Cell D3, enter a 1 for a default number to start with as the starting Input Value
- Resize Cell H1 where the target Picture will Change automatically
- Enter a VLOOKUP formula in Cell H1, to lookup the value entered in cell D3, and load the picture into cell H1, the target cell
Syntax: =VLOOKUP(D3,CatTable,2,FALSE) – Formulas must begin with an equal sign, must not contain any spaces, arguments must be separated by commas
Leave a Reply