To autofit an image in an Excel cell, insert it with Insert > Pictures > Place in Cell in Excel for Microsoft 365, then adjust the row height and column width to the space you want. The image scales with its cell when you resize it. If your picture is already floating over the worksheet, use the Place in Cell command to convert it first.
There is no separate AutoFit command that measures a picture and automatically sets the cell’s row and column to its exact dimensions. Excel’s AutoFit commands primarily size cells to their contents. For a dependable result, make the cell the size you need and let the in-cell image adapt to it.
What You’ll Need
- Excel for Microsoft 365 on Windows, with the Place in Cell option available. Some older Excel versions do not have this feature.
- An image file, such as a JPG or PNG, saved somewhere you can access, or a picture already in the worksheet.
- A worksheet cell where you want the image to appear. For a neat image gallery, plan the column width and row height before inserting several pictures.
Step-by-Step
- Choose the destination cell. Open the worksheet and click the cell that should contain the image. If the image belongs beside a name or item number, select the cell in the same row as that record. Each in-cell picture occupies one cell, so leave adjacent cells available for any labels or other information.
- Insert the picture as an in-cell image. On the Windows ribbon, choose Insert > Pictures > Place in Cell > This Device. Browse to the image, select it, and choose Insert. In some Microsoft 365 builds, the wording or arrangement under Pictures can differ slightly, but choose the option that says Place in Cell, not the option that places a picture over cells.
- Check that it is in the cell. Click the image. An in-cell picture behaves as the selected cell’s content: the cell is selected, rather than a separate floating object with handles around the picture. You can also click another cell and back again to check that the picture remains associated with its original cell. If it is a floating object, use the conversion step below.
- Set the column width. Point to the boundary between the column letters at the top of the sheet. Drag the boundary to make the column wider or narrower. You can also select a cell in that column and choose Home > Format > Column Width, then enter a value. The right width depends on the worksheet’s layout and the image’s intended display size; Excel column-width units are not the same as pixels.
- Set the row height. Point to the boundary between the row numbers and drag it up or down. For a specific value, select a cell in that row and choose Home > Format > Row Height. Adjust the row and column until the image is large enough to see while keeping the table easy to scan. The picture updates as the cell dimensions change.
- Adjust the image’s source proportions if needed. Excel fits an in-cell image into the cell area, but the image’s shape and the cell’s shape may not match. If the result has unused space or does not show the composition you want, edit or crop a copy of the image before inserting it. Avoid making a wide photo fit a very tall, narrow cell if you need to see the whole subject clearly.
- Convert a picture that is already on the sheet. Right-click the floating picture and choose Place in Cell, if that command appears. Excel moves the image into a cell, usually the cell beneath the picture’s upper-left corner. Check the destination afterward: if it landed in the wrong row or column, undo the change, select the intended cell, and insert the picture there using Place in Cell.
- Repeat consistently for a set of images. For a catalogue or staff list, set the column width and row height for the first image, then use the same dimensions for the other image rows. You can select several row headings and set a shared row height through Home > Format > Row Height. Insert each picture into the cell on its corresponding row and confirm that each one is in the cell rather than floating above the grid.
- Save and check the sheet at its normal viewing size. Zoom out or scroll through the worksheet to check that images remain legible and do not make the rows unnecessarily tall. If you plan to sort or filter the records, confirm that each image is in the same row as the correct record. Save the workbook after checking the layout.
Common Mistakes
- Choosing the floating-picture option. Inserting with the regular picture-over-cells option creates a separate object. It can cover cells and may not follow sorting the way an in-cell picture does. Choose Place in Cell when you want the image to behave like cell content.
- Expecting AutoFit to size the cell to the picture. Home > Format > AutoFit Row Height and AutoFit Column Width are not reliable ways to measure an image and create a matching cell. Set row height and column width deliberately instead.
- Resizing only the picture, not the cell. With an in-cell image, the cell dimensions control the available display area. Dragging a row or column boundary is the practical way to change that area; you do not resize it like a separate floating picture.
- Assuming the image will fill every cell edge. A cell and a photo may have different proportions. Fitting an image into the cell does not mean every image will fill the entire rectangle with no unused space. Prepare a crop that suits the cell shape if edge-to-edge presentation matters.
- Sorting pictures separately from their records. Floating pictures can be difficult to keep aligned with data. Use in-cell images and sort the complete table or the relevant rows together, rather than sorting only the picture column or moving images independently.
Tips
Decide on a standard thumbnail size before adding a large group of pictures. For example, make a dedicated image column and use one consistent row height for every record. This makes the sheet easier to scan and avoids changing the layout repeatedly. Try the dimensions on one row first; once they look right, apply them to the other rows.
Use concise filenames or a neighboring description column to identify images, especially when the pictures look similar. Keep a backup of original image files if you crop or resize them outside Excel. A small, consistently shaped source image can make a worksheet quicker to load and easier to share than a collection of very large originals.
For a picture that must remain floating, you can make it move and resize with its underlying cells: select the picture, right-click, choose Format Picture, open Size & Properties, expand Properties, and select Move and size with cells. This links its movement and size to the grid, but it does not convert the picture into cell content. It may still overlap neighboring cells, so use Place in Cell when you need the image contained in one cell.
On Mac, the exact ribbon placement can vary with the Excel version and update channel. Look under Insert > Pictures for Place in Cell, or check the picture’s context menu for the conversion command. If you cannot find either option, your installed version may not support in-cell pictures; update Microsoft 365 if possible or use the floating-picture method as a fallback. Excel for the web may also show different menus, so check for Place in Cell before relying on the desktop steps.
Troubleshooting
The picture covers several cells. It was probably inserted as a floating picture. Right-click it and look for Place in Cell. If the command is missing, check that Excel is up to date and that the file is open in a version that supports in-cell pictures. As a temporary alternative, use the floating-picture settings to move and size it with cells, then position it carefully.
The image looks too small after insertion. Increase the column width, row height, or both. Confirm that you changed the row and column containing the picture, not a neighboring one. If the image still seems small, its proportions may leave unused space inside the cell; use a better-cropped source image rather than stretching the cell into an awkward shape.
The row does not change when you use AutoFit Row Height. This is expected when the command does not use the image as a content measurement. Set a specific row height with Home > Format > Row Height, or drag the row boundary. The in-cell picture will adjust to the available cell area.
The image is in the wrong row. A converted floating picture may be placed in the cell under its upper-left corner. Undo, click the intended destination cell, and insert the image there using Place in Cell. If you have already made other edits, move the image only after checking the correct cell reference and the adjacent record labels.
The picture does not stay aligned when sorting. Check whether it is a floating object or an in-cell image. Convert it with Place in Cell if available, and sort the full table or entire record range so image cells remain with their associated data. Avoid sorting just one column in a multi-column list.
Frequently Asked Questions
Can Excel automatically resize a cell to match an image?
Not with a dedicated picture-based AutoFit command. You can set row height and column width yourself, and an in-cell picture adjusts to those dimensions. The standard AutoFit commands are not a dependable way to size a cell from an image.
How do I make a picture move and resize with a cell?
For a true in-cell image, select Insert > Pictures > Place in Cell. For a floating image, use Format Picture > Size & Properties > Properties > Move and size with cells. The floating option links the object to the grid but does not put it inside the cell.
Can I put more than one picture in a cell?
An in-cell picture is a single cell value, so use one image per cell. To show several images in one row, put one in each neighboring cell, or create a combined image file before inserting it.
Will in-cell pictures stay with rows when I sort or filter?
They are designed to behave as cell content, which helps them stay with their records during normal table operations. Make sure you sort the complete table or record range, not just one column, so the rest of each row stays together too.
Why can’t I see Place in Cell?
Your Excel version or update channel may not include the feature, or you may be using a menu that only offers floating pictures. Check for Microsoft 365 updates and inspect both the Insert > Pictures menu and the right-click menu for an existing picture. If the command is still unavailable, use a floating picture with Move and size with cells as a workaround.
Does this work in Excel for the web or on Mac?
Availability and menu wording depend on the Excel version. Look for Place in Cell under Insert > Pictures or in an existing picture’s context menu. If it is missing, use a supported, updated Excel version or the floating-picture workaround; the Windows ribbon steps may not match your interface exactly.
Related
- Fixing Broken Links in Excel: Find and Repair Them
- Find Same Names in Two Excel Columns
- FIND in Excel: Syntax, Examples, and Common Errors
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel Scatter Plot With Dates: Setup and FormattingTo make an Excel scatter plot with dates, put real Excel dates in one column and the corresponding…
- How to Add Multiple Footnotes in Word and Manage ThemTo add multiple footnotes in Microsoft Word, place the cursor where a note marker should appear, choose References…
- Excel Data Analysis Regression: Run and Interpret ItTo run a linear regression in Excel for Microsoft 365 on Windows, arrange the outcome values in one…
- How to Block a Sender in the Outlook App on Any DeviceTo block someone in Outlook, open a message from them and use the Block sender option in the…
- How to Hyperlink in Excel SharePointTo hyperlink in an Excel workbook stored on SharePoint, open the workbook, select a cell, press Ctrl+K in…
- How to Wrap Text in Google Sheets Using a FormulaTo make text appear on separate lines inside a Google Sheets cell, insert a line break with CHAR(10)…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.