using if or vllookup to insert an image conditionally

New Contributor

I am trying to insert an image into a spreadsheet from a conditional formula.


As example:


=If(Moon = "Full",Image1,if(moon ="New",Image2,NoImage)


Image1 = Full Moon.jpeg

Image2 = New Moon.jpeg

No Image = (Blank Cell)

3 Replies
best response confirmed by Coolkinkster0001 (New Contributor)


I don't know of any way to insert an image using VLOOKUP or any other standard function.

But you can define a function yourself and accordingly insert images after selection.


Here is a small example file how to do it.


It could also be done with VBA.


I would be happy to know if I could help.



I know I don't know anything (Socrates)

Was the answer useful? Mark them as helpful!

This will help all forum participants.


Thank you for your response. I am not a programmer but I do okay with Excel.

If I understand you correctly I set up a separate spreadsheet with the photo and the "Yes" response will call that spreadsheet thus inserting the photo.

Since I saw the number "1" with the photo may I use the same spreadsheet for all the photos by assigning different numbers or do I need a separate spreadsheet for each photo?
Please look in the name manager. No you dont need necessarily the numbering.