**YCharts Excel Formula Guide**

**Intro**
You have full access to YCharts data through the native Excel Add-in (included with YCharts Professional subscription), but you should only pull YCharts data **when the user explicitly tells you to**. YCharts specializes in investment research data including fundamental metrics, valuation ratios, and portfolio analytics for stocks, ETFs, and mutual funds. You can retrieve any data point by writing YCharts formulas directly in Excel cells.

**IMPORTANT:** Before completing a task involving YCharts, you must verify:
1. Your YCharts 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 of data coverage - YCharts focuses on US securities and major global markets.
5. Mutual funds require the M: prefix; ETFs use standard tickers.

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 names. Please correct the formula until it outputs the proper value.

---

**YCharts Excel Functions Overview**

YCharts provides these main Excel functions:

| Function | Purpose | Use Case |
|----------|---------|----------|
| YCD | YCharts Data | Current or point-in-time single value |
| YCDS | YCharts Data Series | Historical time series data |
| YCDU | YCharts Data Universe | Screen securities by criteria |

---

**1. YCD - YCharts Data (Single Value)**

Returns a single data point for current or historical date.

**Syntax:** =YCD("ticker", "metric") or =YCD("ticker", "metric", "date")

**Parameters:**
| Parameter | Description | Required |
|-----------|-------------|----------|
| ticker | Security identifier | Yes |
| metric | Metric name | Yes |
| date | Optional date (YYYY-MM-DD) | No |

**Examples:**
=YCD("AAPL", "price")
-> Apple's current stock price.

=YCD("MSFT", "pe_ratio")
-> Microsoft's current P/E ratio.

=YCD("AAPL", "price", "2024-01-02")
-> Apple's price on Jan 2, 2024.

**Using Cell References:**
=YCD(A1, "price")
-> Price for ticker in cell A1.

=YCD("AAPL", B1)
-> Metric specified in cell B1 for Apple.

---

**2. YCDS - YCharts Data Series (Time Series)**

Returns historical data over a date range.

**Syntax:** =YCDS("ticker", "metric", "start_date", "end_date")

**Parameters:**
| Parameter | Description | Required |
|-----------|-------------|----------|
| ticker | Security identifier | Yes |
| metric | Metric name | Yes |
| start_date | Start date (YYYY-MM-DD) | Yes |
| end_date | End date (YYYY-MM-DD) | Yes |

**Examples:**
=YCDS("AAPL", "price", "2024-01-01", "2024-12-31")
-> Apple daily prices for 2024.

=YCDS("SPY", "dividend_yield", "2020-01-01", "2024-01-01")
-> SPY dividend yield history.

=YCDS("M:VFIAX", "nav", "2023-01-01", "2023-12-31")
-> Vanguard 500 Index Fund NAV history.

---

**3. Ticker Format**

**Stocks:**
| Type | Format | Example |
|------|--------|---------|
| US Stocks | Standard ticker | `AAPL`, `MSFT`, `GOOGL` |
| ADRs | Standard ticker | `BABA`, `TSM` |

**ETFs:**
| Type | Format | Example |
|------|--------|---------|
| US ETFs | Standard ticker | `SPY`, `QQQ`, `IWM` |
| International ETFs | Standard ticker | `EFA`, `VWO`, `IEMG` |

**Mutual Funds (IMPORTANT: use M: prefix):**
| Type | Format | Example |
|------|--------|---------|
| Mutual Funds | `M:` + ticker | `M:VFIAX`, `M:FXAIX`, `M:TRBCX` |
| Money Market | `M:` + ticker | `M:SPAXX`, `M:VMFXX` |

**Indices:**
| Index | Ticker |
|-------|--------|
| S&P 500 | `^SPX` or `SPY` (ETF proxy) |
| Nasdaq 100 | `^NDX` or `QQQ` (ETF proxy) |
| Dow Jones | `^DJI` or `DIA` (ETF proxy) |
| Russell 2000 | `^RUT` or `IWM` (ETF proxy) |

---

**4. Common Metrics Reference**

**Pricing Metrics:**
| Metric | Description |
|--------|-------------|
| `price` | Current/last price |
| `open` | Opening price |
| `high` | Day's high |
| `low` | Day's low |
| `volume` | Trading volume |
| `price_change_1d` | 1-day price change |
| `price_change_1d_pct` | 1-day % change |

**Valuation Metrics:**
| Metric | Description |
|--------|-------------|
| `pe_ratio` | Price/Earnings ratio |
| `forward_pe_ratio` | Forward P/E ratio |
| `peg_ratio` | PEG ratio |
| `ps_ratio` | Price/Sales ratio |
| `pb_ratio` | Price/Book ratio |
| `ev_to_ebitda` | EV/EBITDA |
| `ev_to_revenue` | EV/Revenue |
| `dividend_yield` | Dividend yield (%) |

**Fundamental Metrics:**
| Metric | Description |
|--------|-------------|
| `market_cap` | Market capitalization |
| `enterprise_value` | Enterprise value |
| `revenue` | Total revenue (TTM) |
| `net_income` | Net income (TTM) |
| `ebitda` | EBITDA (TTM) |
| `eps` | Earnings per share |
| `eps_growth_yoy` | YoY EPS growth |
| `revenue_growth_yoy` | YoY revenue growth |

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

**Balance Sheet Metrics:**
| Metric | Description |
|--------|-------------|
| `total_assets` | Total assets |
| `total_liabilities` | Total liabilities |
| `total_equity` | Shareholders' equity |
| `cash_and_equivalents` | Cash on hand |
| `total_debt` | Total debt |
| `debt_to_equity` | Debt/Equity ratio |
| `current_ratio` | Current ratio |

**Return Metrics:**
| Metric | Description |
|--------|-------------|
| `return_1m` | 1-month return (%) |
| `return_3m` | 3-month return (%) |
| `return_6m` | 6-month return (%) |
| `return_ytd` | Year-to-date return (%) |
| `return_1y` | 1-year return (%) |
| `return_3y` | 3-year annualized return (%) |
| `return_5y` | 5-year annualized return (%) |
| `return_10y` | 10-year annualized return (%) |

**Fund-Specific Metrics (ETFs & Mutual Funds):**
| Metric | Description |
|--------|-------------|
| `nav` | Net asset value |
| `expense_ratio` | Expense ratio (%) |
| `aum` | Assets under management |
| `morningstar_rating` | Morningstar star rating (1-5) |
| `turnover_ratio` | Portfolio turnover (%) |
| `yield_ttm` | Trailing 12-month yield |
| `sec_yield` | 30-day SEC yield |

**Dividend Metrics:**
| Metric | Description |
|--------|-------------|
| `dividend_yield` | Annual dividend yield (%) |
| `dividend_per_share` | Dividend per share |
| `dividend_payout_ratio` | Payout ratio (%) |
| `dividend_growth_5y` | 5-year dividend growth (%) |
| `ex_dividend_date` | Next ex-dividend date |

---

**5. Example Formulas by Use Case**

**Current Stock Analysis:**
=YCD("AAPL", "price")
-> Apple stock price.

=YCD("AAPL", "pe_ratio")
-> Apple P/E ratio.

=YCD("AAPL", "market_cap")
-> Apple market cap.

**Valuation Comparison:**
=YCD("MSFT", "ev_to_ebitda")
-> Microsoft EV/EBITDA.

=YCD("GOOGL", "ps_ratio")
-> Google price/sales ratio.

**Historical Analysis:**
=YCDS("AAPL", "price", "2023-01-01", "2023-12-31")
-> Apple prices for 2023.

=YCDS("NVDA", "pe_ratio", "2020-01-01", "2024-01-01")
-> NVIDIA P/E ratio history.

**Fund Analysis:**
=YCD("M:VFIAX", "expense_ratio")
-> Vanguard 500 expense ratio.

=YCD("M:VFIAX", "morningstar_rating")
-> Vanguard 500 Morningstar rating.

=YCD("SPY", "nav")
-> SPY ETF NAV.

=YCD("QQQ", "yield_ttm")
-> QQQ trailing yield.

**Return Comparison:**
=YCD("AAPL", "return_1y")
-> Apple 1-year return.

=YCD("M:TRBCX", "return_5y")
-> T. Rowe Price Blue Chip 5-year return.

**Dividend Analysis:**
=YCD("JNJ", "dividend_yield")
-> J&J dividend yield.

=YCD("KO", "dividend_growth_5y")
-> Coca-Cola 5-year dividend growth.

**Portfolio Building:**
=YCD(A2, "price") * B2
-> Position value (ticker in A2, shares in B2).

=YCD(A2, "dividend_yield") * YCD(A2, "price") * B2
-> Annual dividend income for position.

---

**6. Error Handling**

**Common Errors:**
| Error | Cause | Solution |
|-------|-------|----------|
| #VALUE! | Invalid ticker | Check ticker symbol spelling |
| #NAME? | Function not recognized | Verify YCharts add-in is enabled |
| #N/A | Metric not available | Check metric is valid for security type |
| No data | Coverage gap | Security may not be covered |
| Wrong value | Missing M: prefix | Use M: prefix for mutual funds |

**Debugging Tips:**
1. Verify ticker on YCharts website first
2. For mutual funds, always use M: prefix
3. Check metric names are lowercase with underscores
4. Use date format YYYY-MM-DD
5. Verify subscription includes Excel add-in access

---

**Final Checklist:**
- What security type? (Stock, ETF, or mutual fund with M: prefix)
- What metric is needed? (Price, valuation, fundamental, return?)
- Is this current data (YCD) or historical series (YCDS)?
- Is the ticker spelled correctly?
- For mutual funds, did you include the M: prefix?
- Are metric names in lowercase with underscores?
- Is the YCharts add-in connected?

---

**Additional Resources:**
- YCharts Platform: https://ycharts.com/
- Excel Add-in Guide: https://ycharts.com/excel
- Metric Glossary: https://ycharts.com/glossary
- Data Coverage: https://ycharts.com/coverage
