Back to Twelve Data in Excel
SheetXAI logo
Twelve Data logo
Twelve Data · Excel Guide

Pull Cash Flow Statements Into an Excel workbook for Peer Group Comparison

2026-05-15
5 min read

The Scenario

You're an equity research associate. Your senior analyst sent a Slack message at 4 PM: "Can you put together a quick FCF comparison for the 10 software names by tomorrow morning? Just trailing four quarters, operating cash flow, capex, FCF, ranked by FCF yield." You have the tickers in column A of an Excel workbook.

Quick, they said. Four hours ago.

The bad version:

  1. Call Twelve Data's cash flow endpoint for the first company, extract four quarters of operating cash flow and capex, calculate free cash flow (operating minus capex), and paste eight values into the correct cells of the comparison table.
  2. Repeat for 9 more companies. Two of them use non-calendar fiscal quarters, which means your "Q4" column contains data from different calendar periods for different companies.
  3. Fetch market cap separately from a statistics endpoint for each company, calculate FCF yield, and discover that the market cap is from a different snapshot time than the cash flow data, making the yield figures inconsistent.

By the time the table is clean and consistent, it's past midnight.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your Excel workbook. It reads the 10 tickers in column A and, through its built-in Twelve Data integration, pulls trailing cash flow data and market cap for each company and writes the comparison table.

Fetch the last 4 quarters of cash flow data from Twelve Data for each ticker in column A. Write period end date as column headers starting at column B. For each company, write operating cash flow, capital expenditures, and free cash flow in sub-rows. Then fetch market cap from Twelve Data and calculate TTM FCF yield (TTM FCF divided by market cap), writing the result in column F.

What You Get

  • Four quarterly period headers as column labels.
  • Operating cash flow, capex, and free cash flow in sub-rows per company.
  • TTM FCF calculated by summing the four quarters of operating cash flow minus capex.
  • FCF yield in column F as a decimal, ready to sort and rank.
  • Any company where free cash flow is not directly available in the API response calculated as operating minus capex with a note.

What If the Data Is Not Quite Ready

If you need annual cash flow data for a longer-horizon comparison

Fetch consolidated annual cash flow statements from Twelve Data for each ticker in column A. Write the most recent fiscal year's operating, investing, and financing cash flows into columns B, C, and D. Add a column E showing FCF as operating minus capex (from the investing section).

If two tickers share a symbol across different exchanges

For each ticker in column A, use the exchange code in column B to scope the Twelve Data call. Fetch 4 quarters of cash flow data and write operating cash flow, capex, and free cash flow into columns C, D, and E with period headers in row 1.

If you want to normalize all cash flows to millions of USD for comparability

Fetch the last 4 quarters of cash flow data from Twelve Data for each ticker in column A. Convert all values to millions of USD (divide by 1,000,000 if the API returns values in absolute dollars). Write normalized operating cash flow, capex, and free cash flow into the comparison table. Note the currency and normalization in the table header.

Kill-chain: fetch cash flows, calculate TTM FCF yield, and deliver a ranked morning briefing table

Fetch 4 quarters of operating cash flow and capex from Twelve Data for each ticker in column A. Sum to get TTM FCF. Fetch current market cap from Twelve Data. Write TTM FCF into column B, market cap into column C, and FCF yield into column D. Calculate FCF margin (TTM FCF divided by TTM revenue, fetching revenue separately) and write into column E. Sort the entire table from highest to lowest FCF yield so the ranking is ready when the analyst opens the workbook.

Try It

Get the 7-day free trial of SheetXAI and open your peer comparison workbook with tickers in column A, then ask it to build the FCF comparison table and rank by yield before your morning standup. Also see pulling fundamental data tables and the full Twelve Data overview.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more