Insert a Picture Into a Cell in Excel
By ExcelReady TeamUpdated 6 min read
The short answer
In Microsoft 365, select a cell and choose Insert > Pictures > Place in Cell. The image becomes the cell's value, so it sorts, filters and resizes with the cell. To show a picture from a web address, use the IMAGE function instead. In older Excel, set a floating picture to move and size with cells.
Key takeaways
- Insert > Pictures > Place in Cell puts the image inside the cell in Microsoft 365, not floating on top.
- A picture in a cell moves with sorting and filtering and can be returned by XLOOKUP like any value.
- =IMAGE(url) shows a picture from an https web address and can take alt text and a sizing option.
- In older Excel, pictures float over cells. Set them to Move and size with cells so they stay in place.
- Make the row taller and the column wider first: an in-cell picture shrinks to fit the cell.
On this page+
- Picture in a cell vs picture over cells
- How to insert a picture into a cell (Microsoft 365)
- How to change a floating picture into an in-cell picture
- How to show a picture from a web address with IMAGE
- How to look up a picture with XLOOKUP
- How to lock a picture to a cell in older Excel
- Why your picture looks wrong in a cell
- Practise it
To insert a picture in a cell in Excel, use Insert > Pictures > Place in Cell in Microsoft 365. The image then lives inside the cell, like a number or a word, so it stays with its row when you sort, filter or resize. You can also show a picture from a web address with the IMAGE function, or, in older Excel, pin a floating picture to a cell. This guide covers all three, plus how to look up a product photo with XLOOKUP.
Picture in a cell vs picture over cells#
Excel has two kinds of pictures, and the difference explains most problems people have.
| Picture in a cell | Picture over cells | |
|---|---|---|
| Where it sits | Inside one cell, as its value | Floating on top of the grid |
| Moves when you sort or filter | Yes | Only if set to move with cells |
| Can a formula return it | Yes (XLOOKUP, INDEX, FILTER) | No |
| Size | Fits inside the cell | Any size you drag |
| Versions | Microsoft 365 | All versions |
A picture over cells is the classic kind: you can drag it anywhere, but it doesn't belong to any cell. A picture in a cell behaves like data. For product lists, staff directories and catalogues, the in-cell kind is almost always what you want.
How to insert a picture into a cell (Microsoft 365)#
In Microsoft 365 on Windows, Mac or the web, follow these steps:
- Make the cell big enough first. Drag the row border down and the column border right, or set the size with Home > Format > Row Height. The cells, rows and columns lesson practises resizing.
- Click the cell where the picture should go.
- Go to Insert > Pictures > Place in Cell.
- Choose This Device for a file on your computer, or Stock Images or Online Pictures.
- Pick the image and click Insert.
The picture shrinks to fit inside the cell and keeps its shape. Make the cell bigger and the picture grows with it. Because the picture is the cell's value, the cell can't also hold text. Put names or labels in the next column.
To give the picture a description for screen readers, look for Alt Text in the cell's right-click menu.
How to change a floating picture into an in-cell picture#
If a picture already floats over the sheet, you can move it into a cell. Select the picture, right-click it and choose Place in Cell. Excel moves it into the cell near its top-left corner.
To go the other way, right-click the cell and choose Place over Cells. The picture becomes a normal floating image again, which is useful when you want it larger than one cell.
Don't merge cells to make room for a big picture. Merged cells cause trouble with sorting and copying, as explained in the guide to merge and center and its alternatives. Make the row taller instead.
How to show a picture from a web address with IMAGE#
The IMAGE function shows a picture from an internet address inside a cell. It's part of Microsoft 365. The syntax is:
=IMAGE(source, [alt_text], [sizing], [height], [width])| Argument | What it does |
|---|---|
| source | The web address of the picture, starting with https:// |
| alt_text | Optional description for screen readers |
| sizing | 0 = fit in the cell (default), 1 = fill the cell, 2 = original size, 3 = custom size |
| height, width | The size in pixels, used only with sizing 3 |
For example, if D2 holds a link such as https://example.com/img/mug-blue.png, this shows the mug in the cell with a description:
=IMAGE(D2,"Blue mug")The address must start with https:// and point straight at an image file, such as a .png or .jpg. A link to a web page that contains the picture won't work. If the picture can't be loaded, the cell shows an error instead.
How to look up a picture with XLOOKUP#
Because an in-cell picture is a value, a lookup formula can return it. This is how you build a product card or a staff directory where the photo changes when you type a different ID.
| A | B | C | |
|---|---|---|---|
| 1 | ID | Product | Photo |
| 2 | P-101 | Blue mug | (picture) |
| 3 | P-102 | Desk lamp | (picture) |
| 4 | P-103 | Notebook | (picture) |
| 5 | P-104 | Water bottle | (picture) |
Type an ID in E2 and this formula in F2:
=XLOOKUP(E2,A2:A5,C2:C5)With P-103 in E2, F2 shows the notebook picture. Change E2 to P-101 and the mug appears. The XLOOKUP function reference lists the optional arguments, and the guide to XLOOKUP in Excel covers the not-found message. For a full example with names, departments and photos, see the employee lookup sheet.
If column C holds web addresses instead of pictures, wrap the lookup in IMAGE: =IMAGE(XLOOKUP(E2,A2:A5,C2:C5)).
How to lock a picture to a cell in older Excel#
Excel 2021 and older can't put pictures inside cells, but you can make a floating picture stick to one.
- Insert the picture with Insert > Pictures > This Device.
- Hold Alt (Windows) while you drag and resize it. Its edges snap to the cell borders. On a Mac, resize it by eye or type an exact height and width in the next step.
- Right-click the picture and choose Size and Properties (Mac: Format Picture).
- Under Properties, select Move and size with cells.
Now the picture moves when you insert rows above it and shrinks when you make the row smaller. It still won't follow its row when you sort, so in-cell pictures are better if you have Microsoft 365. The guide to inserting and deleting rows and columns shows the row actions that move pictures around.
Why your picture looks wrong in a cell#
Most problems are about cell size or version.
- The picture is tiny. It fits inside the cell. Make the row taller and the column wider. Autofit won't help here, because it sizes for text. See how autofit column width works.
- Place in Cell is missing. Your Excel isn't Microsoft 365, or it needs an update. Use the older method above.
- Someone else sees an error. In Excel versions that don't support in-cell pictures, those cells can't show the image.
- The file is huge. Large photos make the workbook large. Shrink images before you insert them, or use Picture Format > Compress Pictures on floating pictures.
Practise it#
The picture part is a few clicks. The skill that makes it useful is the lookup. Practise XLOOKUP in a live spreadsheet: you type the formula and it checks the result instantly. If resizing rows and columns still feels clumsy, start with the cells, rows and columns lesson.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Column C holds each product's photo file name. In F2, use XLOOKUP to return the file name for the product ID in E2. In Microsoft 365, the same formula returns the picture itself when column C holds in-cell pictures.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Photo file | Photo | |||||
| 2 | mug-blue.png | P-103 | |||||
| 3 | lamp-desk.png | ||||||
| 4 | notebook-a5.png | ||||||
| 5 | bottle-steel.png | ||||||
| 6 | |||||||
| 7 | |||||||
| 8 |
Tip: XLOOKUP needs what to find (E2), where to look (A2:A5) and what to return (C2:C5).
Practise this in a lesson
Frequently asked questions
How do I put a picture inside a cell in Excel?
In Microsoft 365, click the cell, go to Insert > Pictures > Place in Cell and choose This Device, Stock Images or Online Pictures. The picture fits inside the cell and moves with it.
Why don't I see Place in Cell in Excel?
Place in Cell and the IMAGE function are part of Microsoft 365. Excel 2021 and older don't have them, so you can only place pictures over cells there and set them to move and size with cells.
How do I make a picture fit a cell exactly in older Excel?
Hold Alt (Windows) while you drag or resize the picture so its edges snap to the cell borders. Then right-click it, choose Size and Properties, and select Move and size with cells.
Can XLOOKUP return a picture?
Yes, if the pictures are placed in cells or made with the IMAGE function. The picture is the cell's value, so =XLOOKUP(E2,A2:A5,C2:C5) returns the picture for the ID in E2.
How do I turn a floating picture into an in-cell picture?
Select the picture, right-click it and choose Place in Cell. To go back, right-click the cell and choose Place over Cells.