Company financial models built from primary-source SEC filings: three-statement models, DCF valuations, and a validation tab that ties every historical line back to the 10-K it came from.
I'm Alven, a CPA Finalist (Kenya), awaiting ICPAK membership. This repo is where I publish the technical side of finance: modelling, valuation, and scenario analysis. Every model here ships with a validation tab that cross-references each historical line against the primary filing it came from, checks the balance sheet balances to zero in every year (historical and projected), and ties the cash flow statement's ending cash to the next period's balance sheet. If a figure can't be traced back to a filing, it doesn't go in the model.
Financial-Analyst/
├── Apple/ # Complete: three-statement model + DCF
│ ├── Apple_Financial_Model.xlsx
│ ├── Source_filings/ # 10-K, 10-Q, press releases behind the model
│ └── README.md # Model-specific tabs, validation results, DCF summary
├── validate_model.py # Re-derives every identity outside the spreadsheet
├── tests/
│ └── test_validate_model.py # Breaks a copy of the model, checks each fault is caught
├── .github/workflows/ci.yml # Runs that validator on every push
├── requirements.txt # openpyxl, for the validator only
├── banner.svg
├── LICENSE
└── README.md # This file, repo-wide conventions
Each company gets its own folder with the workbook, the primary-source filings behind it, and a README describing that model's specific assumptions and results. Apple/ is the only complete one right now, see Roadmap for what's next.
- Open
Apple/, the one complete model, and follow its own Quick Start. - In short: open
Apple_Financial_Model.xlsxin Excel or LibreOffice Calc, start on the Dashboard tab, then confirm the Validation tab is fully green before trusting any output. - Or check it without opening Excel at all:
pip install -r requirements.txt && python validate_model.pyre-derives every total independently. See Checking it yourself. - Cross-check any historical line against the source filing in
Apple/Source_filings/.
- Single source of truth for inputs. One Assumptions tab per model; every other tab recalculates from it. Inputs are colour-coded, calculated cells are locked.
- Every historical figure traces to a primary filing, cited down to the page number. FY23 onward is archived in
Apple/Source_filings/; the FY21 and FY22 figures cite the FY2022 and FY2023 10-Ks, which are linked to SEC EDGAR rather than archived here. - A validation tab reports ✓ or ✗ per line, plus structural checks: balance-sheet identity, cash-flow ties, inter-statement consistency, forecast sanity bands.
- Scenario / sensitivity toggles where the question benefits from them (e.g. WACC × terminal growth, revenue growth × operating margin).
- Excel-native. No macros, no external data feeds, no add-ins. Opens in Excel or LibreOffice Calc.
| Layer | Tools |
|---|---|
| Spreadsheet | Microsoft Excel (LibreOffice Calc compatible) |
| Math | Native spreadsheet functions only, no macros, no add-ins |
| Sourcing | SEC EDGAR filings (10-K / 10-Q), company investor-relations press releases |
Every model in this repo follows the same tab layout. Apple/Apple_Financial_Model.xlsx is the concrete example:
| Tab | Contents |
|---|---|
| Dashboard | Headline metrics |
| Cover | Model scope and version |
| Assumptions | Single source of truth for every driver: segment growth, margins, WACC, terminal growth, tax rate |
| IS / BS / CFS | Income statement, balance sheet, cash flow statement: historical years plus a multi-year projection |
| Ratios | Derived ratios |
| DCF | Unlevered FCF build, WACC discounting, Gordon Growth terminal value, sensitivity tables |
| Validation | Line-by-line filing cross-reference, structural integrity checks, forecast sanity bands |
| Pivots / Data Refs | Supporting pivot tables and reference data |
Each validation tab cross-references every hardcoded historical figure against the company's own SEC filings and press releases, checks the balance sheet balances to zero in every year (historical and projected), ties cash-flow ending cash to the next period's balance sheet, and confirms net income and D&A match between the CFS and IS. Forecast years are additionally checked against pre-defined plausibility bands (revenue growth, margins, tax rate, CapEx %, liquidity) so a projection can't silently drift outside a defensible range.
The Validation tab says "ALL CHECKS PASS". That tick is computed by the same
spreadsheet whose correctness is in question, so it is worth exactly as much as
the formulas behind it. validate_model.py exists so you do not have to take it
on trust:
pip install -r requirements.txt
python validate_model.py # defaults to the Apple model
python validate_model.py path/to/Model.xlsx # any model with a Validation tabThis runs in CI on every push, which is possible here and not in the modelling repos: the workbook is committed, it is a few hundred kilobytes, and the checks are arithmetic rather than training, so there is no dataset to fetch and nothing to fit.
The validator is itself tested, which matters more than it might sound. A
script that has only ever been run against a correct workbook proves nothing: it
would report "all checks pass" just as confidently if its comparisons were
inverted or it were reading the wrong rows. So tests/ copies the real model,
breaks one specific thing, and asserts that specific thing is caught. Nine tests
cover a total that no longer adds up, a rounding difference that must still pass,
a duplicate row label, statements laid out over different years, a missing
Validation tab and a missing file. CI runs those first and the real model second.
It reads only the raw line items, adds them up in Python, and compares its own arithmetic against the totals the workbook reports. It never reads a cell whose value is a checkmark. Nineteen identities are re-derived this way: the income statement from segment revenue down to net income, both sides of the balance sheet ending in assets minus liabilities minus equity, the cash flow statement's three sections and its roll-forward, and the cross-statement tie from one year's ending cash to the next year's opening cash. It exits non-zero if any of them break, so it can run in CI.
Current result on the Apple model: 19 of 19 identities match, plus one advisory flag. The advisory is that the cash flow statement's ending cash exceeds the balance sheet's cash line by roughly $0.8B to $1.3B in FY21 through FY23, while FY24 and FY25 agree exactly. Apple's cash flow statement historically reconciled to "cash, cash equivalents and restricted cash" where the balance sheet line excludes restricted cash, so this is most likely the model faithfully reproducing each filing's own presentation rather than an error. It is reported rather than suppressed because "most likely" is not "checked", and it does not affect the roll-forward tie this repo actually claims, which passes in every year.
Apple Inc. (AAPL), the one complete model:
| Metric | Value |
|---|---|
| Historical data points verified against 10-K | 50 / 50 (100%) |
| Verification basis | SEC EDGAR (CIK 0000320193) + Apple investor-relations press releases |
| Filings covered | 10-Ks filed Oct 2022, Nov 2023, Oct 2025 |
| DCF base case | WACC 8.5%, terminal growth 2.5% |
| Implied share price vs. reference price at build time | ≈$240 vs. $232.50, roughly 3% upside |
Full detail, including the two DCF sensitivity tables (WACC × terminal growth, revenue growth × operating margin), is in Apple/README.md.
- Repo conventions: single-source assumptions tab, filing-traced historicals, validation tab, sensitivity toggles
- Apple Inc. (AAPL): three-statement model + DCF, 50/50 data points verified
- Microsoft (MSFT)
- Safaricom (SCOM.NR), Nairobi Securities Exchange
- Equity Group Holdings (EQTY.NR)
MIT. See LICENSE.
Author: Alven Yuka, CPA Finalist (Kenya). Built from primary-source SEC EDGAR filings and company investor-relations disclosures; see each model's own Credits/Validation section for its specific sources.
📫 alvenyuka2@gmail.com · 💼 LinkedIn · 🐙 GitHub
If you spot an error in any model, open an issue with the offending cell reference.