The IMAGE Function in Excel: A Quick Overview

Last Updated on 08/10/2024
Reading time: 2 minutes

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")
IMAGE function returns the image of the employee
  • The picture's size adjusts to match the cell's width and height.
Size of the picture depends on the cell 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).

  1. From a browser, go to your image folder
  2. Select the file of your image
  3. Click on the Share icon
  4. Click on the icon Copy Link
Share a picture from OneDrive professionnal

But if you use this URL directly as an argument with the IMAGE function, it doesn't work 😧

Paste the URL of the file from sharepoint doesnt 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.

Change the last part of the URL to use the link from OneDrive

Leave a Reply

Your email address will not be published. Required fields are marked *

The IMAGE Function in Excel: A Quick Overview

Reading time: 2 minutes
Last Updated on 08/10/2024

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")
IMAGE function returns the image of the employee
  • The picture's size adjusts to match the cell's width and height.
Size of the picture depends on the cell 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).

  1. From a browser, go to your image folder
  2. Select the file of your image
  3. Click on the Share icon
  4. Click on the icon Copy Link
Share a picture from OneDrive professionnal

But if you use this URL directly as an argument with the IMAGE function, it doesn't work 😧

Paste the URL of the file from sharepoint doesnt 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.

Change the last part of the URL to use the link from OneDrive

Leave a Reply

Your email address will not be published. Required fields are marked *