We tend to think of spreadsheets as only containing numbers and text but did you know you can insert an image inside a cell in Google Sheets? There are two ways to do this and we’ll talk you through the steps in this short guide.
Why insert an image into Google Sheets?
There are several occasions when it might be useful to embed an image in a cell in Google Sheets. For example, you may want to:
- Add product images or labels to your inventory and stock lists
- Insert photos of team members or students
- Add your company logo and designs to created branded files to share with clients and customers
- Upload an image of a receipt to your expenses spreadsheet
- Create dynamic dashboards with designs and images
How to insert an image into a Google Sheets cell
There are two methods for inserting a photo or image into Google Sheets:
- With the Google Sheets IMAGE formula.
- Using Insert in cell from the menu.
Google Sheets IMAGE function
This formula enables you to embed an image from the internet directly into a spreadsheet cell.
IMAGE formula has a couple of advantages over the easier Insert in cell option.
- Different modes give you control over how the image will look in the cell.
- You can use a reference to a cell that holds the URL. When you change the URL in the reference cell, the image will update automatically. This can be useful if you have multiple links in a column.
- You can combine IMAGE with VLOOKUP to create an interactive spreadsheet with a dropdown menu and images that change accordingly.
IMAGE(url, [mode], [height], [width])
- url – the link or URL of the image. To get the URL, right click on the image and select Copy image address. This must include the Internet protocol (http or https) and must be enclosed in double-quotes(“) if entered as text. It can also be a reference to a cell that holds the URL.
- mode – this is an optional parameter, which is 1 by default. This specifies how the image is sized within the cell. Below are the four different modes, which Google Sheets uses to render the image in the cell.
- 1 – resizes the image so that it fits inside the cell while maintaining aspect ratio.
- 2 – stretches or compresses the image to fit inside the cell, while ignoring aspect ratio.
- 3 – leaves the image in its original size, which may result in cropping.
- 4 – lets the user define custom size specifications.
- height – this is an optional parameter that indicates how tall an image must be within the cell. You must set the mode parameter to 4 to use this option.
- width – similar to the height parameter, this is also an optional parameter that indicates how wide an image should be within the cell. To use this parameter, the mode must be set to 4, otherwise the formula returns an #N/A! error.
Google Sheets IMAGE formula in use
Take a look at the following examples of IMAGE function:
In all of the examples, the value for the url parameter is either the direct URL string or a reference to the cell B1 where we stored this URL string. The URL points us to the Google logo.
In the first example (cell A4) we haven’t specified the mode. By default it is 1 and therefore the image fits inside the cell, but it maintains the aspect ratio.
In the IMAGE formula in cell A6, the mode parameter is 2. This means the image is stretched/compressed to fit inside the cell. Here, Google Sheets has ignored the aspect ratio.
In cell A7, we typed in 3 for the mode parameter. This keeps the image its original size. As a result, the edges of the image that extend beyond the borders of the cell are cropped.
In the final example (cell A8) we entered 4 for mode parameter before adding values for height and width parameters. The dimensions of the resulting image that Google Sheets displayed in this cell are 30 pixels x 200 pixels.
Can I insert an image directly?
Yes! You can also insert an image directly into the spreadsheet without using a formula. Click on the target cell then go to menu > Insert > Image.
Google Sheets gives you two options: insert an image in cell or insert an image over cells. You can see the second option here: the image is floating on top of the spreadsheet.
Use the image over cells option if you want your image to remain in the same place on the spreadsheet, even if your move or hide cells, rows and columns.
Things to note when you add images to Google Sheets
- One cell can only contain one image.
- If you want to insert a private photo (e.g. it’s not publicly available on the internet) you can insert the URL from an image in Google Photos — but keep data protection laws in mind if using photos of other people.
- An image inside a cell will move with the row if you re-order, sort, or filter the rows.
- It’s not possible to insert a URL from My Drive
- If you’re an advanced user, you can assign a script to an image. The script is triggered when you click on the image.
Discover more useful functions in Google Sheets with 10 tips and tricks that maximize your results in Google Sheets!
Editor’s note: This is a revised version of a previous post that has been updated for accuracy and comprehensiveness.