Many Excel users struggle to dynamically retrieve images, as standard lookup formulas like XLOOKUP or VLOOKUP frustratingly fail to return visual assets. While traditional text-based data retrieval is straightforward, referencing visual data requires bypassing standard grid logic. Mastering dynamic image lookups elevates your reporting, transforming static spreadsheets into highly interactive dashboards. However, this technique stipulates that images must be formatted as "Place in Cell" rather than floating "Over Cells." This capability is ideal for inventory parts catalogs or employee directories. Below, we outline the exact steps to configure this solution using Named Ranges and the INDEX/MATCH formula.
Imagine building an interactive product catalog, an dynamic employee directory, or a polished KPI dashboard in Excel. You select a product ID or an employee's name from a drop-down menu, and not only do their details update instantly, but their corresponding photo or product image dynamically updates as well.
Historically, referencing an image based on a lookup value in Excel was a complex task that required clumsy workarounds, VBA macros, or advanced camera tool tricks. Thankfully, Excel has evolved. Depending on your version of Excel, you can now achieve dynamic image lookups using straightforward formulas, modern in-cell image features, or the classic (yet highly effective) Named Range technique.
In this comprehensive guide, we will explore the three best methods to reference an image cell based on a lookup value in Excel, ranging from the newest Microsoft 365 features to legacy workarounds that work on older versions of the software.
If you are using Microsoft 365 or Excel 2024, Microsoft has introduced a revolutionary feature: In-Cell Images. In older versions of Excel, images always floated on top of the grid (in the drawing layer). Now, images can actually reside inside a specific cell, behaving exactly like text or numbers.
Because the image is treated as standard cell content, you can use your favorite lookup formulas-like XLOOKUP or VLOOKUP-to retrieve them without any special workarounds.
E2 be the cell where users input or select the lookup value (using Data Validation for a clean drop-down menu).=XLOOKUP(E2, A2:A10, B2:B10, "Image Not Found")
How it works: The XLOOKUP function searches for the value in E2 within the range A2:A10. When it finds a match, it returns the corresponding cell content from B2:B10. Because the content of that cell is an embedded image, Excel renders the image directly in the formula cell. If no match is found, it safely displays "Image Not Found".
If you or your team are using an older version of Excel that does not support in-cell images, or if you prefer to work with floating images, you can use the classic Linked Picture combined with a Defined Name (Named Range Formula). This method is incredibly clever because it bypasses Excel's inability to return a floating shape via standard cell formulas.
Create a clean table of data. For example, Column A contains "Product Name" and Column B contains the actual images. Place each image directly over its corresponding cell in Column B. Crucial step: Ensure the images fit entirely within the borders of their cells. If an image overlaps into another cell, the lookup might return parts of neighboring cells.
In a separate sheet or area, create your input cell (e.g., E2 for the product name) and format a target cell where the image will be displayed (e.g., F2).
Because we cannot write a formula directly inside an image object, we must define a custom formula in Excel's Name Manager that resolves to the exact cell containing the desired image.
GetProductImage).INDEX and MATCH formula:
=INDEX(Sheet1!$B$2:$B$10, MATCH(Sheet1!$E$2, Sheet1!$A$2:$A$10, 0))
Note: Replace "Sheet1" with the actual name of your worksheet, and make sure all references are absolute (using $ signs).
B2 (the cell containing the first image, not the image itself), and press Ctrl + C to copy it.F2).=$B$2.=GetProductImage
Your linked picture will now dynamically update to display the contents of whatever cell is returned by the INDEX and MATCH formula. If you change the value in E2, the named formula updates its reference, and the Linked Picture immediately redraws itself to match the newly referenced cell.
If your business stores product images, employee profile pictures, or assets on a web server, cloud storage (like AWS S3), or an intranet portal, you can bypass storing physical images inside your workbook altogether. Excel 365 features a native IMAGE function that can render web-hosted images dynamically using a URL.
This keeps your Excel file size remarkably small, secure, and easily updatable from an external database.
=IMAGE(source, [alt_text], [sizing], [height], [width])
https://example.com/images/sku101.jpg).IMAGE function:
=IMAGE(XLOOKUP(E2, A2:A10, B2:B10, "https://example.com/placeholder.png"))
How it works: The nested XLOOKUP first finds the correct URL string matching the identifier in cell E2. Once retrieved, the IMAGE function instantly fetches that URL and renders the live graphic directly inside the cell. You can even customize the [sizing] argument to stretch, fit, or maintain the original aspect ratio of the dynamic image.
IFERROR or use the built-in fallback argument of XLOOKUP. This prevents ugly error codes from breaking your visual design when a lookup value is deleted or typed incorrectly.
=IFERROR(XLOOKUP(E2, A2:A10, B2:B10), "No Image Available")
IMAGE function), keep in mind that Excel has to make real-time web requests to fetch those files. For massive workbooks, local in-cell images (Method 1) generally offer superior offline performance.| Method | Excel Version Compatibility | Image Storage Location | Key Advantage |
|---|---|---|---|
| In-Cell XLOOKUP | Office 365 / Excel 2024+ | Embedded inside the cells | Easiest to set up; behaves like normal text/data. |
| Named Range & Linked Pic | Excel 2013, 2016, 2019, 2021 | Floating over cells | Works on almost all legacy versions of Excel. |
| IMAGE Function + Lookup | Office 365 / Excel Web | External Web Server / URL | Keeps file sizes tiny; scales beautifully. |
By leveraging these techniques, you can transform flat, data-heavy spreadsheets into dynamic, visually engaging applications. Choose the method that best matches your team's Excel version, and bring your datasets to life!
Disclaimer:
The documents and templates provided on this page are for informational and illustrative purposes only. They do not constitute professional, legal, or financial advice, and should not be relied upon as such. Because individual circumstances and regulatory requirements vary, these materials may not be suitable for your specific needs. We recommend consulting with a qualified professional before adapting or using any of these examples for official or commercial purposes.