The IMAGE function - Insert Pictures in Cells
Microsoft announce exciting new IMAGE function
Announced by Microsoft on 21st February 2023
In this latest article in our Future of Excel series, we look at the new IMAGE function.
So how does it work?
The image is imported and sized using the new IMAGE function:
=IMAGE(source, [alt_text], [sizing], [height], [width])
- Source: The URL path, using an "https" protocol, of the picture file. Supported file formats include BMP, JPG/JPEG, GIF, TIFF, PNG, ICO, and WEBP.
- alt_text: A description of the picture for accessibility.
- sizing: The picture dimensions. There are several possible values:
- 0: Fit the picture in the cell and maintain its aspect ratio.
- 1: Fill the cell with the picture and ignore its aspect ratio.
- 2: Maintain the original picture size, which may exceed the cell boundary.
- 3: Customize the picture size by using the height and width arguments.
- height and width: Only applicable when sizing option 3 is selected, define the height and width of the picture.
Here's a simple example
I would like to bring the Full Stack Modeller logo below into my model.
The logo is stored here:
The formula to bring this image into my Excel spreadsheet with an Alt Text of "Full Stack Modeller" and a sizing of 200 by 300 is:
=IMAGE("https://www.fullstackmodeller.com/hubfs/Full%20Stack%20Modular%20Feature%20Images.webp", "Full Stack Modeller", 3, 200, 300)
This is a very helpful new feature from Microsoft. The ability brings images straight into a workbook via a formula will undoubtedly prove useful to anyone who regularly works with images in their spreadsheets.
It is a shame that you can only bring images in from HTTPS addresses rather than from a local drive, or from within the model itself. Hopefully, this will be added to the IMAGE function in the near future.
The feature is currently available in the 365 version of Excel.