> ## Documentation Index
> Fetch the complete documentation index at: https://docs.brandfetch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Brandfetch with Microsoft Excel

Microsoft Excel's `IMAGE` function can load any Brandfetch CDN URL directly, so you can show live company logos in a spreadsheet without installing an add-on.

<Note>
  `IMAGE` is only available to Microsoft 365 subscribers, and isn't in perpetual licenses like Microsoft Excel 2019 or 2021.
</Note>

## Prerequisites

* A [Brandfetch account](https://developers.brandfetch.com/) with an active client ID

## Basic formula

Drop a hardcoded domain straight into the formula:

```
=IMAGE("https://cdn.brandfetch.io/nike.com?c=BRANDFETCH_CLIENT_ID")
```

## PNG instead of WebP

Brandfetch serves logos in WebP by default. `IMAGE` renders WebP fine on Microsoft Excel desktop (Windows and Mac), but not in [Excel for the web or Android](https://support.microsoft.com/en-us/excel/functions/image-function). Request PNG instead by adding the extension to the type segment (the default type is `icon`):

```
=IMAGE("https://cdn.brandfetch.io/nike.com/icon.png?c=BRANDFETCH_CLIENT_ID")
```

`logo` and `symbol` type variants also support `.svg`, where the brand has a distinct vector asset for that type:

```
=IMAGE("https://cdn.brandfetch.io/nike.com/type/logo.svg?c=BRANDFETCH_CLIENT_ID")
```

## Reference a cell

Most sheets store the domain in a column rather than hardcoding it. Concatenate the cell reference into the URL instead:

```
=IMAGE("https://cdn.brandfetch.io/"&A2&"?c=BRANDFETCH_CLIENT_ID")
```

## Apply to an entire column

Inside a Microsoft Excel Table, `IMAGE` fills down automatically like any other formula column, no array wrapper needed. Using a structured reference:

```
=IMAGE("https://cdn.brandfetch.io/"&[@Domain]&"?c=BRANDFETCH_CLIENT_ID")
```

Outside a Table, drag the fill handle down the column, or select the range and press **Ctrl+D**.

## Sizing

`IMAGE` takes optional `sizing`, `height`, and `width` arguments as its 3rd–5th parameters: `0` (default) fits the image to the cell keeping its aspect ratio, `1` stretches it to fill the cell, `2` keeps the image at its original size regardless of cell size, and `3` uses the custom `height` and `width` you pass in pixels. For predictable results regardless of cell size, size the logo itself using the [Logo API's](/logo-api/parameters) own `w`/`h` path segments and keep `sizing` at `0`:

```
=IMAGE("https://cdn.brandfetch.io/nike.com/w/128/h/128?c=BRANDFETCH_CLIENT_ID", "Nike logo", 0)
```

## Theme and fallback

Any [Logo API parameter](/logo-api/parameters) works the same way inside the formula, for example a dark-theme icon with a lettermark fallback:

```
=IMAGE("https://cdn.brandfetch.io/nike.com/theme/dark/fallback/lettermark/icon?c=BRANDFETCH_CLIENT_ID")
```

## Prefer static pictures? Use a macro

`IMAGE` results stay live, they re-fetch over the network and can't be viewed offline or reliably exported. To freeze logos into the file as real pictures, use a macro instead. This one reads domains from column A and drops a logo next to each one in column B, sized to fit the cell. It requests the `icon.png` variant rather than the WebP default, since `AddPicture` inserts PNG reliably across Office versions:

<Note>
  This needs a current Microsoft 365 desktop build: older Microsoft Excel versions don't fetch URLs in `AddPicture` at all (they raise error 1004, "The specified file was not found").
</Note>

```vb Insert Logos From Column theme={null}
Sub InsertLogosFromColumn()
    Dim ws As Worksheet
    Set ws = ActiveSheet

    Dim clientId As String
    clientId = "BRANDFETCH_CLIENT_ID"

    Dim lastRow As Long
    lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row

    Dim r As Long, domain As String, url As String, cell As Range
    For r = 2 To lastRow
        domain = ws.Cells(r, "A").Value
        If domain <> "" Then
            url = "https://cdn.brandfetch.io/" & domain & "/w/128/h/128/icon.png?c=" & clientId
            Set cell = ws.Cells(r, "B")

            ws.Shapes.AddPicture FileName:=url, LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, _
                Left:=cell.Left, Top:=cell.Top, Width:=cell.Height, Height:=cell.Height
        End If
    Next r
End Sub
```

Open the VBA editor with **Alt+F11** (Windows) or **Fn+Option+F11** (Mac), paste the macro into a new module (**Insert > Module**), then run it with **F5**. Save the workbook as **Excel Macro-Enabled Workbook (.xlsm)** to keep the macro for next time.

## Access all brand data (logos, colors, company data...)

`IMAGE` can only embed images. The rest of a brand's identity, its color palette, fonts, and company info, comes from the [Brand API](/brand-api/overview), which returns JSON and needs an `Authorization` header. Power Query handles both. You'll need a Brand API key from the [API keys page](https://developers.brandfetch.com/dashboard/keys), this is a secret key, separate from the client ID used above.

<Steps>
  <Step title="Connect to the Brand API">
    Go to **Data > Get Data > From Other Sources > From Web** and switch to **Advanced**. Enter `https://api.brandfetch.io/v2/brands/domain/nike.com` as the URL, and under **HTTP request header parameters** add `Authorization` with the value `Bearer YOUR_BRAND_API_KEY`.

    If Microsoft Excel asks how to connect to the source, pick **Anonymous**, authentication already happens through the header.
  </Step>

  <Step title="Pick out the fields you need">
    The Power Query editor opens the response as a record. Drill into the parts you want, for example click the **List** next to `colors`, choose **To Table**, then expand the records into `hex` and `type` columns.
  </Step>

  <Step title="Load it into the sheet">
    Click **Close & Load** to land the result as a worksheet table. **Data > Refresh All** re-fetches it whenever you need current data; each refresh counts against your Brand API plan's quota.
  </Step>
</Steps>

<Warning>
  The API key is saved inside the query, anyone who gets the workbook can read it in the Power Query editor. Share exports (PDF, values-only copies) rather than the workbook itself.
</Warning>
