The Google Sheets IMAGE function is used to insert an image into a cell.
The syntax for the IMAGE function is as follows:
IMAGE(url, [mode], [height], [width])
url: The URL of the image you want to insert into the cell. This URL must be enclosed in quotation marks and must be a link to an image file on the internet.
mode (optional): Specifies how the image is to be displayed in the cell. It is a numerical value with the following options:
height (optional): Specifies the height of the image in pixels. This parameter is only used if the mode is set to 4.
width (optional): Specifies the width of the image in pixels. This parameter is only used if the mode is set to 4.
Follow the steps below to use the image function in Google Sheets.
Search for the image you want to use online. Right-click on the image and choose "Copy image address" to copy the URL.
In the selected cell, type =IMAGE("URL"), but replace "URL" with the actual URL of the image you copied.
Press Enter to insert the image.
To change the image's fit, use =IMAGE("URL", mode). Replace "mode" with:
For our example, we'll replace "mode" with "1" to resize the image to fit the cell.
After pressing "Enter", the image should fit the cell.
For custom dimensions, type =IMAGE("URL", 4, height, width). Replace "height" and "width" with the desired size in pixels.
After configuring the custom dimensions, it should look like this.
Check the inserted image in your cell. If it doesn't look as expected, adjust the size or cell dimensions. You may need to tweak the function parameters for a better fit.
Google Drive doesn't provide a direct URL for images that can be used with the IMAGE function due to its sharing and security framework. The typical shareable link from Google Drive leads to a webpage for the file, not the file itself which prevents direct embedding in Sheets.
The most reliable way to display an image in Google Sheets is by ensuring the image is accessible via a direct link, which usually means hosting the image outside of Google Drive or using services specifically designed to provide direct image URLs.
We hope that you now have a better understanding of how to use the Google Sheets IMAGE function. If you enjoyed this article, you might also like our article on Google Sheets time zone conversion or our article on Google Sheets LAMBDA.