Function · Lookup

Excel IMAGE function

The Excel IMAGE function places a picture in a cell from an https address. Sizing 0 fits the cell and keeps the picture's shape.

Microsoft 365, Excel 2024, and Excel for the web. Excel 2021 and earlier return #NAME?. Google Sheets has an IMAGE function with different arguments.

Syntax =IMAGE(source, [alt_text], [sizing], [height], [width])

IMAGE
=IMAGE("https://example.com/images/widget.png","Blue widget, side view",0)

Arguments

NameRequiredWhat to pass
sourceRequiredThe https address of the picture file. Microsoft accepts BMP, JPG/JPEG, GIF, TIFF, PNG, ICO, and WEBP. Excel for the web and Excel for Android do not show WEBP. A redirected address is blocked. An address that asks for a sign-in does not render.
alt_textOptionalText that describes the picture for someone who cannot see it. Microsoft recommends supplying it.
sizingOptional0 fits the cell and keeps the shape. 1 fills the cell and ignores the shape. 2 keeps the original size, which can extend past the cell. 3 uses height and width, in pixels. A number outside 0 through 3 is #VALUE!.
heightOptionalHeight in pixels, used when sizing is 3. Leave width out and Excel keeps the shape from this height. A value below 1 is #VALUE!. Passing a height with sizing 0, 1, or 2 is #VALUE!.
widthOptionalWidth in pixels, used when sizing is 3. Leave height out and Excel keeps the shape from this width. A value below 1 is #VALUE!. Passing a width with sizing 0, 1, or 2 is #VALUE!.

Examples

A widget picture fitted to the cell

=IMAGE("https://example.com/images/widget.png","Blue widget, side view",0)

Result The picture in the cell. The alt text is Blue widget, side view.

A custom size of 120 by 160 pixels

=IMAGE("https://example.com/images/widget.png","Blue widget, side view",3,120,160)

Result The picture drawn 120 pixels high and 160 pixels wide.

Look up the address, then place the picture

=IMAGE(XLOOKUP("W-14",A2:A3,B2:B3),"Blue widget, side view",0)

Result The widget picture. The $24 stays in the price column.

Height passed with sizing 0

=IMAGE("https://example.com/images/widget.png","Blue widget, side view",0,120,160)

Result #VALUE!

=IMAGE(B1,B2,0)B4
Photo
AB
1Addresshttps://example.com/images/widget.png
2Alt textBlue widget, side view
3Price24
4Photopicture
A picture of the sheet, not a live calculator. B4 holds the formula. The cell shows the picture from the address in B1. This page prints the word picture there because the file is not embedded. The alt text is B2. The $24 in B3 is the price next to the photo.

IMAGE puts a picture inside a cell. The address https://example.com/images/widget.png is a placeholder, not a product photo. The alt text Blue widget, side view is what a screen reader reads. The cell shows the picture. The $24 next to it is a price you typed. IMAGE does not calculate that price.

The address uses https. Microsoft accepts BMP, JPG and JPEG, GIF, TIFF, PNG, ICO, and WEBP. Excel for the web and Excel for Android do not show WEBP. An address longer than 255 characters goes in a cell, and the formula refers to that cell. When F10 holds the long address, the call is =IMAGE(F10). A redirected address is blocked. An address that requires a sign-in does not render. A format outside that list, such as SVG, is #VALUE!.

Sizing 0 fits the picture in the cell and keeps its shape. Sizing 1 fills the cell and can stretch the picture. Sizing 2 keeps the original size, which can extend past the cell border. Sizing 3 takes a height and a width in pixels. Pass both and the picture can stretch. Pass only the height, or only the width, and Excel keeps the shape from the side you gave. A height or a width alongside sizing 0, 1, or 2 is #VALUE!.

A catalog can keep the address in one column and the price in another. W-14 points at https://example.com/images/widget.png and is priced at $24. W-15 points at https://example.com/images/spool.png and is priced at $9.50. =IMAGE(XLOOKUP("W-14",A2:A3,B2:B3),"Blue widget, side view",0) looks up the address and places the picture. The $24 stays in its own cell. XLOOKUP returns the address. HYPERLINK is the clickable label when the row also needs a page to open. The inventory tracker lists A100, A200, and A300 by code and unit cost. The home inventory lists household items and what it would cost to replace them. The product pricing calculator prices a product from its unit cost. None of those workbooks call IMAGE. A photo next to one of those rows is this function, with an https address in the cell beside the formula.

Microsoft 365, Excel 2024, Excel for the web, Excel for iPhone, and Excel for Android phones have IMAGE. Excel 2021 returns #NAME?. Google Sheets has a function with the same name. Its arguments are the address, a mode from 1 to 4, and an optional height and width. It has no alt text argument. Mode 1 fits the cell. An Excel formula that passes alt text in the second argument is a different call there.