I discovered this today and its very useful, so I decided to share it with everybody.
Till now I was able to insert an image in whatever region of a Google Spreadsheet by going to “Insert” > “Image“. But this wasn’t fixing the image to the cell you wanted to place the image to.
As explained on this Google Drive help link, you can enter a URL of an image directly into a cell like this:
Inserting an image inside of a cell
To insert an image inside of a cell, you may use one of the following four options:
- =image(“URL”) or =image(“URL”, 1): Inserting this formula into a cell will scale the image to fit inside of the selected cell. If the cell is bigger than image you’re inserting, the remainder of the cell will be white.
- =image(“URL”, 2): Inserting this formula will stretch the image to fit inside of the selected cell. The aspect ratio (height vs. width) of the image won’t be preserved.
- =image(“URL”, 3): This formula will insert the image into the cell at its original size. If the image is bigger than the cell, some of the image may be cut off.
- =image(“URL”, 4, height, width): Inserting this formula allows you to customize the size of the image by specifying the height and width of the image in pixels. The height and width parameters are required for this option.
What that article doesn’t explains, is how to get the URL of an image that is in Google Drive, and this is the way to get it:
If you need to get the link from an image “hosted” in Google Drive, you need to do the following to get the image link:
1) Right click on the image file already in Google Drive and select “Open with Google Docs”.
2) A Docs file will open and the image will be embedded in it. Without left clicking on the image, directly right click on it and choose “Copy Image URL”.
3) You can use that URL in memory on a Spreadsheet Cell as described before.
Let me know if this worked for you as it did for me 😉