Quick Answer

IMAGE Function

IMAGE inserts a picture from a URL into a spreadsheet cell and lets you control its size and cropping.

✓ Excel✓ Google SheetsExcel Google Sheets only

Syntax

IMAGE
(url, [mode], [height], [width])

Parameters

ParameterDescriptionRequired
urlThe URL of the image to display. Must be a direct link to an image file (e.g., .png, .jpg, .svg).Required
modeSizing mode: 1 = resize to fit, 2 = stretch to fill, 3 = original size, 4 = custom size. Default is 1.Optional
heightImage height in pixels. Used with mode 4.Optional
widthImage width in pixels. Used with mode 4.Optional

Basic Example

Show a logo from a URL inside a cell

=IMAGE('https://example.com/logo.png')
ResultImage displayed in cell

The image is fetched from the URL and displayed in the cell, resized to fit.

Advanced Examples

Example 1: Custom sized image

Product catalog

Display a product image at a fixed 100x100 pixel size

=IMAGE('https://example.com/product.jpg', 4, 100, 100)
Result: 100x100 image in cell
Mode 4 uses the custom height and width arguments.

Example 2: Image from a dynamic cell URL

Image gallery

Show the image whose URL is stored in another cell

=IMAGE(A2, 2)
Result: Image stretched to fill the cell
Mode 2 stretches the image to fill the cell dimensions. A2 contains the URL.

How IMAGE Works

IMAGE fetches the image from the provided URL and renders it inside the cell. The mode parameter controls how the image is sized: fit, stretch, original size, or custom dimensions. The URL must be publicly accessible and point directly to an image file.

1
Get the image URL
Copy the direct link to the image file, not a webpage.
2
Choose a sizing mode
Use 1 to fit, 2 to stretch, 3 for original size, or 4 for custom dimensions.
3
Set dimensions if needed
For mode 4, add height and width in pixels.
4
Enter the formula
Type =IMAGE('URL', mode, height, width).

Important Notes & Limitations

  • IMAGE is Google Sheets only. Excel has limited support for images in cells via newer IMAGE function in some versions, but behavior differs.

  • The URL must be publicly accessible and directly link to an image file.

  • Images may not print or export to PDF consistently.

  • Some image hosting sites block direct linking.

Common Errors & Fixes

Image does not displayThe URL is not a direct image link or the site blocks embedding.

Fix: Use a direct .jpg/.png URL and test it in a browser.

#VALUE! errorThe mode number is invalid or dimensions are missing for mode 4.

Fix: Use 1, 2, 3, or 4. For mode 4, provide both height and width.

Very large imageMode 3 displays the image at original size, which may overflow the cell.

Fix: Use mode 1 or 4 to resize the image.

Download Practice File

Practice IMAGE with Real Data

Download a sample CSV file with pre-populated data and practice exercises for the IMAGE function. Works in both Excel and Google Sheets.

Works in Google SheetsCompatible with ExcelIncludes exercises

File format: CSV (comma-separated values) - opens in Excel, Google Sheets, and all spreadsheet apps

Frequently Asked Questions

Can I use IMAGE with Google Drive photos?
Only if the image is publicly shared and you have a direct download URL. Standard Google Drive sharing links usually do not work.
Can I put an image behind text?
No, IMAGE places the image inside a cell. For floating images, use Insert > Image instead.
Does IMAGE work in Excel?
Excel 365 has added IMAGE for some users, but it is not as universally available as in Google Sheets.
Can I use SVG images?
Google Sheets supports SVG in IMAGE, but rendering may vary depending on the browser.