> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/getting-started/learning/stackai-building-challenges/4.-fill-an-excel-template.md).

# 4. Fill an Excel Template

## Challenge overview

Build a workflow that fills a standard Excel template from a financial database.

The workflow must preserve the template exactly.

### Scenario

> We use a standardized Excel template that must be populated with financial data from our internal database.
>
> The intended workflow is that the user provides a list of ticker symbols.
>
> The system automatically retrieves all relevant investment data for each ticker from the database and inserts it into the correct fields within the template.
>
> The final output must be a fully completed Excel file that strictly follows the template’s structure.
>
> It is absolutely critical that all data is accurate and placed in the exact required cells without altering the template’s formatting or layout.

### Sample files

{% file src="/files/N77R1vWOkjUOhceldof4" %}

{% file src="/files/s7uJNMJopuoTR9iD8T8u" %}

### Example inputs

* `AAPL, MSFT`
* `AMZN`
* `AAPL, MSFT, AMZN, GOOG`
* `Apple and Google`
* `AAPL google`
* `AAPL, MSFT, AMZN, GOOG, NVDA, META, NFLX, JPM, XOM, JNJ, V, UNH, KO, AVGO`

### What to build

Your workflow should:

1. Accept flexible ticker input.
2. Normalize the request into a ticker list.
3. Pull data directly from the provided database.
4. Write the data into the correct cells in the template.
5. Return a completed Excel file.

### Validation target

Use this expected output as a check.

| Ticker | Company Name                    | Stock Price ($) | Market Cap ($B) | Strategy                                               | Sector                              | Seller                                    |  Volume |
| ------ | ------------------------------- | --------------: | --------------: | ------------------------------------------------------ | ----------------------------------- | ----------------------------------------- | ------: |
| AAPL   | Apple Inc.                      |          198.45 |           3,120 | Long — Core Growth Allocation                          | Technology — Consumer Electronics   | Morgan Stanley Institutional Desk         | 125,000 |
| MSFT   | Microsoft Corporation           |          412.78 |           3,065 | Long — Strategic Core Technology Allocation            | Information Technology              | Goldman Sachs Institutional Equities Div. |  98,500 |
| AMZN   | Amazon.com, Inc.                |          178.62 |           1,925 | Long — Global E-Commerce & Cloud Infrastructure Growth | Consumer Discretionary / Technology | JP Morgan Securities LLC                  | 142,000 |
| GOOGL  | Alphabet Inc. (Google)          |          152.37 |           1,910 | Long — Digital Infrastructure & AI Expansion           | Communication Services / Technology | Goldman Sachs Institutional Desk          | 210,000 |
| NVDA   | NVIDIA Corporation              |          742.18 |           1,825 | Long — AI Infrastructure Momentum                      | Technology — Semiconductors         | Citadel Securities LLC                    |  48,000 |
| META   | Meta Platforms, Inc.            |          512.64 |           1,290 | Long — Digital Ads & AI Productization                 | Communication Services              | Morgan Stanley Equity Desk                |  36,500 |
| NFLX   | Netflix, Inc.                   |          678.11 |             302 | Hold — Streaming Cash Flow Compounder                  | Communication Services — Media      | Goldman Sachs Institutional Desk          |  12,250 |
| JPM    | JPMorgan Chase & Co.            |          214.09 |             620 | Long — Quality Financials / Carry                      | Financials — Banks                  | Barclays Capital Inc.                     |  55,000 |
| XOM    | Exxon Mobil Corporation         |          118.73 |             505 | Income — Energy Dividend Core                          | Energy — Integrated Oil & Gas       | Wells Fargo Securities                    |  90,000 |
| JNJ    | Johnson & Johnson               |          162.47 |             392 | Defensive — Healthcare Quality                         | Health Care — Pharmaceuticals       | BofA Securities                           |  41,000 |
| V      | Visa Inc.                       |          298.32 |             610 | Long — Payments Network Growth                         | Financials — Payments               | Jefferies LLC                             |  28,750 |
| UNH    | UnitedHealth Group Incorporated |          557.88 |             520 | Long — Managed Care Leader                             | Health Care — Managed Care          | JP Morgan Securities LLC                  |  15,600 |
| KO     | The Coca-Cola Company           |           64.91 |             281 | Income — Staples Defensive                             | Consumer Staples — Beverages        | UBS Securities LLC                        | 120,000 |
| AVGO   | Broadcom Inc.                   |        1,386.55 |             640 | Long — Semis + Infrastructure Software                 | Technology — Semiconductors         | Deutsche Bank Securities                  |   6,800 |

### Key considerations

{% hint style="info" %}

* Preserve exact sheet names, cell positions, column order, and formatting.
* Prevent hallucinated values.
* Make the database the source of truth.
* Handle different input styles for tickers and company names.
  {% endhint %}

### Extension

* Support a different uploaded Excel template on each run.

### Helpful docs

* [StackAI Computer](/workflow-builder/apps/stackai-computer.md)
* [Fill in Excel Sheets with AI](/getting-started/tutorials-and-examples/fill-in-excel-sheets-with-ai.md)
* [Excel](/workflow-builder/apps/excel.md)
* [Files Node](/workflow-builder/inputs/files-node.md)
* [Template Node](/workflow-builder/outputs/template-node.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stackai.com/getting-started/learning/stackai-building-challenges/4.-fill-an-excel-template.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
