How to insert image into Google Sheets cell


If you want to add an Image to Google Sheets that you can go to Menu → Insert → Image → Drop your Image. But you would see that the image does not gets added to a specific cell.

To add image into a cell, you can use the Formula / Syntax : IMAGE(url, [mode], [height], [width]), parameter mode, height and width are optional.

url: Just add the URL of the image should be accessible via HTTP protocol example:

http://code2care.org/images/logo.png

Example :

mode: This is an optional filed used to resize the image aspect ratio, the default value is set to 1.

1: It will resize the image to fit inside the cell, maintaining aspect ratio.

2: This will stretch or compress the image to fit inside the cell and will ignore aspect ratio.

3: This will leave the image at original size, which may cause cropping.

4: This allows us to set a custom size for the image (setting custom width and height).

Note: This is an optional field, the mode must be set to 4 if custom width and height are used.

Example:

height: You can set the height of the image in pixels.

Note: height is an optional field if used mode must be set to 4.

width: You can set the height of the image in pixels.

Note: width is an optional field if used mode must be set to 4.






Recent Posts:
Hello there!,

You are using AdBlocker!

I am an independent developer trying to help fellow developers and students to resolve issues faced on a day-to-day basis, we 'Code to Care' . There is a lot of expenses involved in hosting and managing a website that's the reason we have ads.

A humble request to you to disable adBlocker on Code2care.org and support us pay our bills.

Thanks,
Cod2ecare - Line's of code for change.

To see contents reload page after unblocking
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities.

Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, How Tos, Blogs, Articles, etc.