Forum Discussion
Insert a conditional image into a cell
- Sep 21, 2023
Here is an example that works with images stored in the workbook itself.
Recent versions of Microsoft 365 have a new function IMAGE
How will the image in cell B5 depend on the value in A5?
- HansVogelaarSep 21, 2023MVP
Here is an example (requires Microsoft 365)
- LiliaDuboisSep 21, 2023Copper Contributor
HansVogelaar Ooooh, thank you so much, this is exactly what I need ❤️ can you just please tell me the details, I'm really grateful
- HansVogelaarSep 21, 2023MVP
The picture over cell B5 has been created using the Camera Tool
I also created a defined name Pic. You can see its definition in Formulas > Name Manager: it refers to
=INDEX(Sheet!$B$30:$B$31,MATCH(Sheet!$A$5,Sheet!$A$30:$A$31,0))
It looks up the cell containing the picture corresponding to the description in A5.
I selected the picture over B5 and entered the formula =Pic in the formula bar. This is the "magic" that causes the image to change depending on the value of A5.