**QuickFS Excel Formula Guide**

**Intro**
You have full access to QuickFS fundamental data through the QuickFS Excel Add-in, but you should only pull QuickFS data **when the user explicitly tells you to**. QuickFS provides comprehensive financial statement data for public companies worldwide, with 20+ years of historical data and easy-to-use Excel formulas. You can retrieve any data point by writing QFS formulas directly in Excel cells.

**IMPORTANT:** Before completing a task involving QuickFS, you must verify:
1. Your QFS formulas do not return errors.
2. All values should seem reasonable and make intuitive sense based on your general knowledge of finance.
3. Use cell references for tickers and metrics when possible as opposed to hardcoded values.
4. Be aware that non-US tickers require country suffix (e.g., AAPL:US, FFH:CA).
5. Metric values are in the company's reporting currency unless otherwise specified.

You should essentially gut check every value that shows up. If there are any errors or the values seem wrong, you likely wrote the formula syntax incorrectly or are using invalid metric codes. Please correct the formula until it outputs the proper value.

---

**QuickFS Excel Functions Overview**

QuickFS provides one main Excel function:

| Function | Purpose | Use Case |
|----------|---------|----------|
| QFS | QuickFS Data | Retrieve fundamental metrics with flexible period selection |

---

**1. QFS - QuickFS Data Function**

Returns fundamental financial data for any public company.

**Syntax:** =QFS("symbol", "metric", "period")

**Parameters:**
| Parameter | Description | Required |
|-----------|-------------|----------|
| symbol | Ticker with optional country code | Yes |
| metric | Metric name | Yes |
| period | Period specification | Yes |

**Examples:**
=QFS("AAPL:US", "revenue", "FY")
-> Apple's most recent fiscal year revenue.

=QFS("MSFT:US", "eps_diluted", "TTM")
-> Microsoft's trailing 12-month diluted EPS.

=QFS("FFH:CA", "book_value_per_share", "FY-1")
-> Fairfax (Canada) book value from prior year.

**Using Cell References:**
=QFS(A1, "revenue", "FY")
-> Revenue for ticker in cell A1.

=QFS("AAPL:US", B1, "FY")
-> Metric specified in cell B1 for Apple.

---

**2. Ticker Format**

QuickFS uses country suffixes to identify markets:

| Market | Suffix | Example |
|--------|--------|---------|
| United States | `:US` (default) | `AAPL:US` or `AAPL` |
| Canada | `:CA` | `FFH:CA`, `RY:CA` |
| United Kingdom | `:LN` | `SHEL:LN`, `HSBA:LN` |
| Germany | `:DE` | `SAP:DE`, `BMW:DE` |
| France | `:FP` | `MC:FP`, `OR:FP` |
| Australia | `:AU` | `BHP:AU`, `CBA:AU` |
| Japan | `:JP` | `7203:JP`, `9984:JP` |
| Hong Kong | `:HK` | `0005:HK`, `0700:HK` |
| Europe (general) | `:EUROPE` | `NESN:EUROPE` |

**Note:** US tickers can omit the suffix. All other markets require the suffix.

---

**3. Period Specification**

**Fiscal Year Periods:**
| Period | Description |
|--------|-------------|
| `FY` | Most recent fiscal year |
| `FY-1` | 1 fiscal year ago |
| `FY-2` | 2 fiscal years ago |
| `FY-N` | N fiscal years ago |

**Fiscal Quarter Periods:**
| Period | Description |
|--------|-------------|
| `FQ` | Most recent fiscal quarter |
| `FQ-1` | 1 quarter ago |
| `FQ-2` | 2 quarters ago |
| `FQ-N` | N quarters ago |

**Trailing Periods:**
| Period | Description |
|--------|-------------|
| `TTM` | Trailing twelve months |

**Range Periods (returns array):**
| Period | Description |
|--------|-------------|
| `FY-9:FY` | Last 10 fiscal years |
| `FY-4:FY` | Last 5 fiscal years |
| `FQ-7:FQ` | Last 8 quarters |

**Absolute Periods:**
| Period | Description |
|--------|-------------|
| `FY-2023` | Fiscal year ending in 2023 |
| `FY-2022` | Fiscal year ending in 2022 |

---

**4. Common Metrics Reference**

**Income Statement:**
| Metric | Description |
|--------|-------------|
| `revenue` | Total revenue |
| `cost_of_goods_sold` | Cost of goods sold |
| `gross_profit` | Gross profit |
| `operating_expenses` | Operating expenses |
| `operating_income` | Operating income (EBIT) |
| `ebitda` | EBITDA |
| `interest_expense` | Interest expense |
| `pretax_income` | Pre-tax income |
| `income_tax` | Income tax expense |
| `net_income` | Net income |
| `eps_basic` | Basic earnings per share |
| `eps_diluted` | Diluted earnings per share |

**Balance Sheet:**
| Metric | Description |
|--------|-------------|
| `total_assets` | Total assets |
| `current_assets` | Current assets |
| `cash_and_equivalents` | Cash and equivalents |
| `short_term_investments` | Short-term investments |
| `accounts_receivable` | Accounts receivable |
| `inventory` | Inventory |
| `total_liabilities` | Total liabilities |
| `current_liabilities` | Current liabilities |
| `accounts_payable` | Accounts payable |
| `short_term_debt` | Short-term debt |
| `long_term_debt` | Long-term debt |
| `total_debt` | Total debt |
| `total_equity` | Shareholders' equity |
| `retained_earnings` | Retained earnings |

**Cash Flow Statement:**
| Metric | Description |
|--------|-------------|
| `cfo` | Cash from operations |
| `cfi` | Cash from investing |
| `cff` | Cash from financing |
| `capex` | Capital expenditures |
| `free_cash_flow` | Free cash flow |
| `dividends_paid` | Dividends paid |
| `shares_repurchased` | Share buybacks |

**Per Share Metrics:**
| Metric | Description |
|--------|-------------|
| `eps_basic` | Basic EPS |
| `eps_diluted` | Diluted EPS |
| `book_value_per_share` | Book value per share |
| `tangible_book_value_per_share` | Tangible book value per share |
| `revenue_per_share` | Revenue per share |
| `fcf_per_share` | Free cash flow per share |
| `dividends_per_share` | Dividends per share |

**Valuation Metrics (no period needed):**
| Metric | Description |
|--------|-------------|
| `price` | Current stock price |
| `mkt_cap` | Market capitalization |
| `enterprise_value` | Enterprise value |
| `pe_ratio` | P/E ratio |
| `ps_ratio` | P/S ratio |
| `pb_ratio` | P/B ratio |
| `ev_to_ebitda` | EV/EBITDA |
| `ev_to_revenue` | EV/Revenue |
| `dividend_yield` | Dividend yield (%) |

**Profitability Ratios:**
| Metric | Description |
|--------|-------------|
| `gross_margin` | Gross margin (%) |
| `operating_margin` | Operating margin (%) |
| `net_margin` | Net profit margin (%) |
| `roe` | Return on equity (%) |
| `roa` | Return on assets (%) |
| `roic` | Return on invested capital (%) |

**Shares & Other:**
| Metric | Description |
|--------|-------------|
| `shares_basic` | Basic shares outstanding |
| `shares_diluted` | Diluted shares outstanding |
| `employees` | Number of employees |
| `fiscal_year_end` | Fiscal year end month |

---

**5. Example Formulas by Use Case**

**Current Fundamentals:**
=QFS("AAPL:US", "revenue", "FY")
-> Apple annual revenue.

=QFS("MSFT:US", "net_income", "TTM")
-> Microsoft trailing net income.

=QFS("GOOGL:US", "eps_diluted", "FY")
-> Alphabet annual EPS.

**Historical Data:**
=QFS("AAPL:US", "revenue", "FY-1")
-> Apple revenue from last year.

=QFS("AMZN:US", "ebitda", "FY-2")
-> Amazon EBITDA from 2 years ago.

**Multi-Year Trends (array formulas):**
=QFS("NVDA:US", "revenue", "FY-9:FY")
-> NVIDIA 10-year revenue history.

=QFS("META:US", "eps_diluted", "FY-4:FY")
-> Meta 5-year EPS history.

**Quarterly Data:**
=QFS("AAPL:US", "revenue", "FQ")
-> Apple most recent quarter revenue.

=QFS("TSLA:US", "net_income", "FQ-3")
-> Tesla net income 3 quarters ago.

**Valuation (current - no period):**
=QFS("AAPL:US", "price")
-> Apple current price.

=QFS("MSFT:US", "pe_ratio")
-> Microsoft P/E ratio.

=QFS("GOOGL:US", "mkt_cap")
-> Google market cap.

**International Stocks:**
=QFS("FFH:CA", "book_value_per_share", "FY")
-> Fairfax Holdings (Canada) book value.

=QFS("SHEL:LN", "revenue", "FY")
-> Shell (London) annual revenue.

=QFS("SAP:DE", "net_income", "FY")
-> SAP (Germany) net income.

**Profitability Analysis:**
=QFS("AAPL:US", "gross_margin", "FY")
-> Apple gross margin.

=QFS("MSFT:US", "roe", "FY")
-> Microsoft return on equity.

=QFS("GOOGL:US", "net_margin", "TTM")
-> Google trailing profit margin.

**Cash Flow Analysis:**
=QFS("AAPL:US", "free_cash_flow", "FY")
-> Apple free cash flow.

=QFS("BRK.A:US", "cfo", "FY")
-> Berkshire operating cash flow.

---

**6. Error Handling**

**Common Errors:**
| Error | Cause | Solution |
|-------|-------|----------|
| #VALUE! | Invalid ticker | Check ticker and country suffix |
| #N/A | Data not available | Company may not be covered or data missing for period |
| #NAME? | Function not recognized | Verify QuickFS add-in is installed |
| Wrong data | Missing country suffix | Add :US, :CA, :LN etc. for non-US stocks |
| Stale data | Cache issue | Refresh add-in data |

**Debugging Tips:**
1. Verify ticker exists on QuickFS.net
2. Add country suffix for non-US stocks
3. Check metric names are lowercase with underscores
4. For valuation metrics, omit period parameter
5. Use FY/FQ for relative periods, FY-2023 for absolute

---

**Final Checklist:**
- Is the ticker correct with appropriate country suffix?
- Is the metric name spelled correctly (lowercase, underscores)?
- Is the period specification correct? (FY, FQ, TTM, or range)
- For valuation metrics (price, pe_ratio, etc.), did you omit the period?
- Is the QuickFS add-in connected?
- Are you within your subscription's data limits?

---

**Additional Resources:**
- QuickFS Platform: https://quickfs.net/
- Excel Add-in: https://quickfs.net/excel
- Metric Documentation: https://quickfs.net/docs/metrics
- Company Coverage: https://quickfs.net/coverage
