Ravindra BagaleCourses & study guides मराठी Track your progress

9. Dynamic Arrays

9.17 IMAGE: Pictures Inside Cells

Example first. Shahrukh prepares a fictional product list for a Kolhapur dark store: product name, price and a picture link. He wants the picture inside the cell, so that when he sorts or filters the list, each picture stays with its product. A picture inserted with Insert › Pictures floats over the sheet and does not move with sorting. The IMAGE function puts the picture in the cell itself.

IMAGE — in 30 seconds

What: IMAGE shows a picture from an https web address inside a cell. The picture belongs to the cell, so it moves when you sort, filter or resize.

Why: Product lists, staff lists and catalogues are easier to check with pictures, and in-cell pictures survive sorting and filtering.

Tiny example: =IMAGE("https://ravindrabagale.com/apple-touch-icon.png","Course icon") shows this course's icon inside the cell.

First look at the data (before → after):

IMAGE: before and after tables, fictional Blinkit Maharashtra data

Expected result — What you should see in column D

Row D: Result
2 a picture (once you replace the example.com link with a real one)
3 a picture (same)
4 a picture (same)
5 the course icon, fitted inside the cell
Before table and formula as text

Before — Catalogue in A1:C5 (links in column C)

A: Product B: Price (₹) C: Picture link
Milk 500 ml 32 https://example.com/img/milk.png
Bread 45 https://example.com/img/bread.png
Paneer 200 g 90 https://example.com/img/paneer.png
Course icon (real test link) — https://ravindrabagale.com/apple-touch-icon.png

Formula / click path

D2: =IMAGE(C2,A2)
source = C2 (an https link)   alt_text = A2 (the product name, read aloud by screen readers)
Fill D2 down to D5

Do it step by step:

  1. Type the catalogue in A1:C5. Rows 2 to 4 use placeholder links; row 5 uses the real course icon link.
  2. In D2 type =IMAGE(C2,A2) and fill down to D5.
  3. Row 5 shows the icon. Rows 2 to 4 show an error until you put real https picture links in C2:C4.
  4. Make row 5 taller with Home › Format › Row Height (for example 60) and watch the picture grow to fit.
  5. In E5 try a fixed size: =IMAGE(C5,A5,3,40,40) shows a 40 by 40 pixel picture.
  6. Sort the list by Price with Data › Sort and check that every picture stays with its product.

Version note

Microsoft lists IMAGE for Excel for Microsoft 365 (Windows and Mac), Excel 2024 (Windows and Mac), Excel for iPhone and Excel for Android phones. Pictures are downloaded from the internet, so you need a connection, and your organisation's security settings can block them (#BLOCKED!).

Syntax

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

Argument Meaning
source (required) The web address of the picture. It must start with **https**. Formats: BMP, JPG/JPEG, GIF, TIFF, PNG, ICO and WEBP (WEBP is not supported on the web and Android).
alt_text A short description for screen readers. Always fill it; the product name is a good choice.
sizing 0 = fit inside the cell and keep the shape (default), 1 = fill the cell and ignore the shape, 2 = original size (may spill over the cell edge), 3 = custom size with height and width
height, width In pixels, only with sizing 3. If you give only one, Excel keeps the shape.

Example 2: picture by lookup. Put a product name in G2 and show its picture:

=IMAGE(XLOOKUP(G2,A2:A5,C2:C5),G2)

Change G2 and the picture changes. This is how a "product card" on a dashboard works.

Example 3: a picture column in a Table. Convert the catalogue to a Table (Ctrl + T) and type =IMAGE([@[Picture link]],[@Product]) in a new column. Every new product row gets its picture automatically.

Rules from Microsoft's page (why a picture may not show)

Problem What Excel does Fix
The link starts with http (not https) The picture does not load Use an https link
The site needs a login (for example a private SharePoint or Google Drive link) The picture does not render Use a public https link
The link redirects to another address Blocked for security reasons Open the link in a browser and copy the final address (right-click the picture › Copy image link)
The link is longer than 255 characters Too long to type in the formula Put the link in a cell and use =IMAGE(C2)
Unsupported format, wrong sizing value, or height/width with sizing 0–2 #VALUE! Check the format and the arguments
No internet or server problem #CONNECT! Check the connection and try again
Security settings block linked images #BLOCKED! Check the settings for Linked Data Types (or enable images in the bar at the top on the web)

IMAGE vs Insert › Pictures

IMAGE function Insert › Pictures
Lives inside one cell floats over the cells
Sort and filter moves with its row stays where it is
Source an https link a file on your computer or online
Changes by formula yes (XLOOKUP, IF, etc.) no

The example.com links on this page are placeholders: replace them with your own public https picture links. The course icon link is real and was checked to load directly (no redirect). The result of IMAGE is a picture, so there are no numbers to compute for this lesson. Microsoft reference: IMAGE function.

Practice task (try it before you open the answer):

  1. Add a column Stock in column F with values 12, 0, 5, 20 to the catalogue.
  2. Show the picture only when Stock is more than 0; otherwise show the text "Out of stock".
  3. Make every picture exactly 50 pixels high and keep its shape.
Answer
  1. In F2:F5 type the stock numbers 12, 0, 5, 20.
  2. =IF(F2>0,IMAGE(C2,A2),"Out of stock") filled down; row 3 (Bread) shows Out of stock.
  3. =IMAGE(C2,A2,3,50): sizing 3 with only the height given keeps the shape.

Ravindra Bagale's Tip

Keep picture links in their own column, never typed inside the formula. Links change; a column is easy to fix, a formula on 500 rows is not.