How to Embed Images Inside Excel Cells Using the IMAGE Function
🔍 WiseChecker

How to Embed Images Inside Excel Cells Using the IMAGE Function

You need to place pictures directly into your Excel spreadsheet for reports or dashboards. Manually inserting and resizing images is slow and they float over the grid. The IMAGE function in Excel provides a formula-based method to embed pictures directly inside cells. This article explains how to use the IMAGE function and manage the images it displays.

Key Takeaways: Embedding Images with the IMAGE Function

  • IMAGE function syntax: Use =IMAGE(“url”) to insert a picture from a web address into a single cell.
  • Image sizing options: The function’s fourth argument controls if the image fits the cell, keeps its original size, or stretches.
  • Supported file formats: The function works with common web image formats including JPG, PNG, GIF, and BMP.

What the Excel IMAGE Function Does

The IMAGE function is a dynamic formula that retrieves and displays a picture from a specified source. Unlike the Insert > Pictures command, which places a floating object on the sheet, IMAGE anchors the picture directly within a cell’s boundaries. The image becomes a cell value that can be referenced by other formulas. When you copy the cell, the image copies with it. The function requires an internet connection to fetch images from web URLs the first time. It is available in Excel for Microsoft 365 and Excel for the web.

Steps to Insert an Image with the IMAGE Function

To embed a picture, you need a publicly accessible URL pointing directly to an image file. You cannot use file paths from your local computer like C:\Pictures\file.jpg.

  1. Get a direct image URL
    Find an image online and copy its image address. Right-click the picture in your browser and select “Copy image address” or a similar option. The URL should end with a file extension like .jpg or .png.
  2. Enter the basic IMAGE formula
    Select the cell where you want the image to appear. Type the formula starting with an equals sign. For example, type =IMAGE(“https://example.com/photo.jpg”) and press Enter. Excel will fetch and display the image, fitting it to the cell by default.
  3. Use the optional sizing argument
    The full syntax is =IMAGE(source, [alt_text], [sizing], [height], [width]). The third argument, sizing, is a number from 1 to 4. Enter the formula as =IMAGE(“url”, , 1). The number 1 fits the image to the cell while keeping its proportions. Number 0 stretches the image to fill the cell exactly, which may distort it.
  4. Resize the cell to adjust the image
    Click and drag the row height or column width borders. The image will scale dynamically to fit the new cell dimensions if you used sizing option 1. For more control, you can specify exact height and width in the formula’s last two arguments.

Using the Function with Alt Text and Custom Dimensions

You can provide descriptive alt text for accessibility and define precise image size in pixels.

  1. Add alternative text
    In the formula, include the second argument. For example: =IMAGE(“https://example.com/logo.png”, “Company Logo”, 1). This text is read by screen readers.
  2. Set a fixed height and width
    Use the fifth and sixth arguments to override cell size. A formula like =IMAGE(“url”, , 3, 150, 300) will display the image at 150 pixels tall and 300 pixels wide, independent of the cell’s dimensions. Sizing argument 3 is required for this to work.

Common Mistakes and Limitations to Avoid

Excel Shows a #VALUE! or #BLOCKED! Error

A #VALUE! error often means the URL is invalid or the image format is not supported. Check that the link is correct and directly points to an image file. A #BLOCKED! error indicates the image host has security restrictions preventing Excel from accessing it. You may need to host the image on a different service or use a different picture.

Image Does Not Update When the Source Changes

Excel caches the image after the first download. If you change the picture at the same URL, Excel may continue to show the old version. To force a refresh, you can clear the cache. Go to File > Options > Advanced. Scroll to the General section and click “Web Options”. On the Files tab, check the box for “Empty Temporary Internet Files folder when browser is closed”. Close and reopen Excel.

Function is Not Available in Your Excel Version

The IMAGE function is only in newer versions of Excel for Microsoft 365 and Excel for the web. If you type =IMAGE( and nothing happens, your version does not support it. You will need to use the legacy Insert > Picture method instead.

IMAGE Function Sizing Options Compared

Item Option 1: Fit to Cell (Default) Option 0: Fill Cell Option 3: Use Custom Dimensions
Description Image scales to fit within the cell, maintaining its original aspect ratio Image stretches or compresses to fill the cell’s exact height and width, often causing distortion Image displays at the exact pixel height and width specified in the formula arguments
Sizing Argument 1 0 3
Cell Size Dependency Image resizes when you change the row or column size Image resizes when you change the row or column size Image size is fixed, regardless of cell dimensions
Best For Dashboards where cell sizes may change Creating uniform colored backgrounds in cells Product catalogs requiring precise, consistent image sizes

You can now embed pictures directly into Excel cells using a formula. The IMAGE function lets you build dynamic reports where images update with your data. For related functionality, explore the new Stock and Geography data types which can also pull in logos and flags. Remember that using sizing argument 3 with custom height and width gives you the most control over the final display.