Forum Discussion
Show images conditionally
- May 24, 2017
Hi Gosse,
This https://excelribbon.tips.net/T010450_Displaying_Images_based_on_a_Result.html tip could help
1. In C1 cell use =IF(AND(A1>10,B1<5),CHOOSE(RANDBETWEEN(1,3),"mb_1","mb_2","mb_3"),"x") this formula to generate "mb_1", "mb_2" and "mb_3" three images name based on your condition.
2. Select C1 cell and click on Formula | Define Name and type: "ShowPhoto" as name and =INDIRECT(Sheet1!$C$1) as refers to.
3. Insert 3 marble ball images into E11, F11, G11 and H11. And name these cells as "mb_1", "mb_2", "mb_3" and "x" and refers to as below:
For E11, =Sheet1!$E$11, For F11, =Sheet1!$F$11 For G11, =Sheet1!$G$11 For H11, =Sheet1!$H$11
4. Select E11 cell and Click on Home | Copy | Copy as picture. While a dialog box appear, Click on "Ok" to copy it. Now press Ctrl+V on that sheet to paste the image.
5. Select the pasted image and enter =ShowPhoto in the formula bar to link it.
6. Now change the value A1 or B1 to change the condition of C1 which will generate a image name and pasted image will change the image like below image:
Image: Changing the image based on condition
Here I have attached the whole working file. So that you can try it.
For more reference, an article on below link will helpful:
http://afaysal.blogspot.com/2017/05/how-to-display-image-in-worksheet-based.html
Hope this will help you.