Author: Oscar Cronquist Article last updated on September 09, 2022

How to use the IMAGE function

The IMAGE function inserts an image into cells using an Excel formula.

Formula in cell E3:

=IMAGE("https://www.get-digital-help.com/wp-content/uploads/2022/09/flower.png")

The IMAGE function is soon available to Excel 365 subscribers.

1. IMAGE Function Syntax

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

Back to top

2. IMAGE Function Arguments

How to use the IMAGE function arguments

source Required. URL path, files on your hard drive won't work.
[alt_text] Optional. Alternative text describing the image.
[sizing] Optional.
0 - Fit cell. Fits the image in the cell and keeps its aspect ratio. (Default)
1 - Fill cell. Fills the cell, the aspect ratio is not maintained.
2 - Original size. The image is displayed with its original height and width.
3 - Customize size. Lets you specify the height and width.
[height] Optional. Custom height.
[width] Optional. Custom width.

Back to top

3. Show an image based on a drop-down list

How to use the IMAGE function example 1

This example shows an IMAGE function linked to a drop-down list located in cell C4. A lookup is performed when the user selects a value. The corresponding URL on the same row as the lookup value is then used in the IMAGE function to load the correct image.

Formula in cell C2:

=IMAGE(XLOOKUP(C4,B8:B9,C8:C9))

3.1 Add a drop-down list

  1. Select cell C4.
  2. Go to tab "Data" on the ribbon.
  3. Press with mouse on the "Data Validation" button. A dialog box appears.
    How to use the IMAGE function dropdown list
  4. Select "List" in the drop-down list below "Allow:".
  5. Press with left mouse button on the "Arrow" button below "Source" and then select cell range B8:B9. Press Enter.
  6. Press with left mouse button on "OK" button to dissmiss the dialog box.

A drop-down list handle appears when you select cell C4, see the image below.

How to use the IMAGE function dropdown list2

Press with left mouse button on the "arrow" to expand values in the drop-down list, see the image below.

How to use the IMAGE function dropdown list1

Press with mouse on a value to select it.

Back to top

3.2 Explaining formula

Step 1 - Lookup selected drop-down value

The XLOOKUP function search one column for a given value, and return a corresponding value in another column from the same row.

Function syntax: XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])

XLOOKUP(C4,B8:B9,C8:C9)

becomes

XLOOKUP("Leaf",{"Flower";"Leaf"},{"https://www.get-digital-help.com/wp-content/uploads/2022/09/flower.png";"https://www.get-digital-help.com/wp-content/uploads/2022/09/Leaf.png"})

and returns

"https://www.get-digital-help.com/wp-content/uploads/2022/09/Leaf.png".

Step 2 - Evaluate the IMAGE function

The IMAGE function inserts an image into cells using an Excel formula.

Function syntax: IMAGE(source, [alt_text], [sizing], [height], [width])

IMAGE(XLOOKUP(C4,B8:B9,C8:C9))

becomes

IMAGE("https://www.get-digital-help.com/wp-content/uploads/2022/09/Leaf.png")

and displays the image in cell C2.

Back to top

4 IMAGE function - #CONNECT error

How to use the IMAGE function connect error

The IMAGE function returns #CONNECT! error if the function fails to load the image.

Back to top

5 IMAGE function - #BUSY error

How to use the IMAGE function busy error

The IMAGE function shows #BUSY! error until the image is fully loaded.

Back to top