Excel 365’s IMAGE function lets you insert images directly into cells via a URL, enhancing the visual aspect of your data. Unlike traditional objects, images inserted using this function are treated like cell content, making them sortable, filterable, and referenceable.
The syntax of the IMAGE function
=IMAGE(source, [alt_text], [sizing], [height], [width])
- source: The URL of the image (required).
- alt_text: Descriptive text for accessibility (optional).
- sizing: Specifies how the image fits in the cell. Options include Fit, Fill, Original, and Custom.
- height/width: Pixel dimensions for custom sizing (optional).
Key Considerations
- Images rely on URLs and require an internet connection to display.
- Images will resize with cells, acting as part of the data.
- Ensure image URLs are publicly accessible to prevent loading errors.
Practical Uses
This function is very useful in this situation
- Product Catalogs: Display product images alongside descriptions.
- Country Flags: Enhance reports by showing flags next to country names.
- Employee Lists: Add profile pictures for team members.
- Dashboards: Use icons or logos to improve dashboard interactivity.
Example to use the IMAGE function
- Let's add the faces of our employees to a cell. Each picture has been generated with AI from the website This Person Does Not Exist - Random Face Generator
- Each employee's picture has been uploaded to our server
- For example, the URL for John Smith is https://excel-tutorial.com/database/image/John_Smith.png
- Write the formula =IMAGE("https://excel-tutorial.com/database/image/John_Smith.png")
- The picture's size adjusts to match the cell's width and height.
How to use URL of pictures stored in SharePoint or OneDrive?
Of course, not all companies have easy access to a server. But you can use the URL of your picture in your SharePoint folder or OneDrive (professional account).
- From a browser, go to your image folder
- Select the file of your image
- Click on the Share icon
- Click on the icon Copy Link
But if you use this URL directly as an argument with the IMAGE function, it doesn't work 😧
However, if you modify the last part of the URL by replacing everything after the '?' with 'download=1', it will now work 😉 This trick has been given by How To Power BI.