Skip to main content

Use images in GPT function prompts in Excel

Use images in your prompts with GPT for Excel and vision models. These models are multimodal and can process both text and images as input.

tip

Don't have image URLs yet? Learn how to host images on Google Drive for AI processing.

info

Supported image formats: PNG, JPEG, WebP, non-animated GIF

Models that support vision

We recommend using gpt-5.2 to analyze images, but you can use any vision model supported by GPT for Excel.

Click here for a list of all vision models supported by GPT for Excel.
ProviderModelWithout API keyWith API key

OpenAI

gpt-4.1

gpt-4.1-mini

gpt-4.1-nano

gpt-4o

gpt-5

gpt-5-chat

gpt-5-mini

gpt-5-nano

gpt-5.1

gpt-5.2

o3

o4-mini

Anthropic

claude-4-sonnet

claude-4.5-haiku

claude-4.5-sonnet

Mistral

mistral-medium

xAI

grok-4-1-fast

grok-4-1-fast-non-reasoning

Prompt images

Use the GPT_VISION function to describe or analyze images in individual cells.

Using the model switcher

  1. Open GPT for Excel.

  2. In the sidebar, select GPT functions.

  3. Expand the model switcher and select a vision model.

    A vision model in the model switcher
  4. In the , select a cell and write your formula:

    =GPT_VISION("Extract the coffee brand from this image. Normalize the brand name to title case.",C9)
    A GPT_VISION formula

    The formula uses the vision model selected in the model switcher.

For instructions on how to write formulas with the GPT_VISION function and set the image resolution, see the GPT_VISION reference.

Specifying the model in the formula

  1. Open GPT for Excel.

  2. In the , select a cell and write your formula, specifying a vision model directly in the formula:

    =GPT_VISION("Extract the coffee brand from this image. Normalize the brand name to title case.",C9, , , "gpt-4.1")
    A GPT_VISION formula with the model parameter

    The formula uses the vision model regardless of what's currently selected in the model switcher.

For instructions on how to write formulas with the GPT_VISION function and set the image resolution, see the GPT_VISION reference.

Host images on Google Drive for AI processing

To process an image in GPT for Excel, you need the direct URL of the image and the URL must be publicly accessible.

To host an image on Google Drive so that GPT for Excel can access and process it:

  1. Upload the image to Google Drive.

  2. Share the image publicly using the Anyone with the link option. For more information, see Google Drive Help.

    tip

    To prevent other users from commenting or editing the image, set the access role to Viewer.

  3. Copy the link.

  4. Get the image file ID from the link URL, and build the following new URL with the ID:

    https://drive.google.com/uc?id=<image-file-id>

    For example:

    # Original share URL from "Copy link"
    https://drive.google.com/file/d/1dTZrIkAHsV_hKnvL2KjH1pfcOOSpYVux/view

    # Direct image URL
    https://drive.google.com/uc?id=1dTZrIkAHsV_hKnvL2KjH1pfcOOSpYVux

You now have a direct image URL that you can access and process in GPT for Excel.