I have the file, or in my case, an image in google drive. I have shared the image and have pulled out the shared image id and created a formula that shows the image in google spreadsheets. Here's what I did: I pasted the "shared" url in A2 like this: https://drive.google.com/file/d/1EhVwghULXFmhX4aFvCdYzB-uVzrj-Szi/view?usp=sharing

I used the following formula in B2 to populate the picture:

=iferror(hyperlink(A2,IMAGE(("https://docs.google.com/uc?export=download&id=")&(mid(A2, (find("/d/",A2))+3, (find("/view",A2))-(find("/d/",A2))-3)),4,175,175)),"")

This works like a charm. What I want to do is place the image file name in cell C2. Is there a formula I can use to perform this? I prefer a formula to a script if possible. I this example, the desired file name is "16532_MCK00753EG copy.jpg".

Another option would be to insert the image based on the file name instead of the file ID. I would be OK with that route, but favor using formulas instead of scripts.

Here's a sample sheet: https://docs.google.com/spreadsheets/d/1JRhGJjsjEWDmEi8W5wjnZsti4aTjZUgdB9JOrQR5bIs/edit?usp=sharing

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.