A comprehensive Python toolkit for creating Excel-based equity valuation models with automated data retrieval, sensitivity analysis, and easy ticker symbol changes directly in Excel.
- Download or open any generated Excel file (e.g.,
AAPL_ev_ebitda_model.xlsx) - Find the yellow ticker symbol cell (B2) at the top of the spreadsheet
- Change the symbol to analyze a new company (e.g., "AAPL" β "MSFT")
- Run the simple script:
- Windows: Double-click
generate_models.bat - Mac/Linux: Run
./generate_models.shin terminal
- Windows: Double-click
- Enter the new ticker symbol and select model types
- Get your new Excel files in the output/ folder
π Complete Excel Usage Guide - Detailed instructions with screenshots
- π― Excel-Based Symbol Input: Change ticker symbols directly in Excel templates
- π Multiple Valuation Models: EV/EBITDA, EV/Sales, and DCF models with 5-year exit scenarios
- π Automated Data Retrieval: Fetches current financial data from Yahoo Finance and Financial Modeling Prep APIs
- π Professional Excel Templates: Embedded formulas, sensitivity analysis, and color-coded results
- β‘ Simple Regeneration: User-friendly batch scripts for non-technical users
- π§ Reusable Framework: Easily generate models for any publicly traded stock
git clone https://github.com/Brobertmod/equity-valuation-models.git
cd equity-valuation-models
pip install -r requirements.txt# Windows
generate_models.bat
# Mac/Linux
./generate_models.sh# Generate all models for Apple Inc.
python examples/analyze_stock.py AAPL
# Generate specific models
python examples/analyze_stock.py MSFT --models ev_ebitda dcfAAPL_ev_ebitda_model.xlsx- EV/EBITDA valuation with 5-year exit scenariosAAPL_ev_sales_model.xlsx- EV/Sales valuation with 5-year exit scenariosAAPL_dcf_model.xlsx- Discounted Cash Flow model with detailed 5-year projections
Premium API keys are configured in config/api_keys.yaml for enhanced data access:
fmp_api_key: "your_financial_modeling_prep_key"
alpha_vantage_key: "your_alpha_vantage_key"- Yahoo Finance (Free, no API key required)
- Financial Modeling Prep (Enhanced data with premium API key) β Configured
- Alpha Vantage (Additional metrics with premium API key) β Configured
For real-time data access directly in Excel, install the Financial Modeling Prep Excel add-in:
π Excel Add-in Setup Guide - Complete installation and usage instructions
Key Benefits:
- Real-time price updates in Excel
- Dynamic financial data functions
- Peer comparison capabilities
- Complements Python-generated models
- Highlighted yellow cell (B2) in all templates for easy symbol identification
- Clear instructions for changing symbols and regenerating models
- Error handling for invalid symbols or missing data
- EV/EBITDA: Projects EBITDA growth with multiple exit scenarios
- EV/Sales: Projects revenue growth with multiple exit scenarios
- DCF: Detailed 5-year cash flow projections with terminal value
- All calculations use Excel formulas that update automatically
- Change assumptions to see immediate impact on valuations
- Professional sensitivity analysis with color-coded results
equity-valuation-models/
βββ src/
β βββ data_fetcher.py # Financial data retrieval
β βββ excel_generator.py # Excel template generation
β βββ models/ # Valuation model implementations
β βββ utils/ # Helper utilities
βββ examples/
β βββ analyze_stock.py # Main analysis script
βββ config/
β βββ api_keys.yaml # API configuration
βββ output/ # Generated Excel files
βββ generate_models.bat # Windows batch script
βββ generate_models.sh # Unix shell script
βββ EXCEL_USAGE_GUIDE.md # Detailed Excel usage instructions
βββ requirements.txt # Python dependencies
- Enterprise Value to EBITDA multiple analysis with growth projections
- 5-year EBITDA growth assumptions and exit multiple scenarios
- Annualized return calculations and total return analysis
- Professional sensitivity analysis with conditional formatting
- Enterprise Value to Sales multiple analysis with revenue growth
- 5-year revenue projections and exit multiple scenarios
- Market multiple comparisons and return calculations
- Color-coded sensitivity tables for different growth/multiple combinations
- Comprehensive 5-year cash flow projections
- Terminal value calculations with growth assumptions
- WACC-based discounting and equity value derivation
- Dual-axis sensitivity analysis (WACC vs Terminal Growth)
- "Script says success but I see old data": You're likely looking at the old file instead of the new one. The scripts create NEW files with the new symbol name (e.g.,
MSFT_ev_sales_model.xlsx), they don't update existing files. - Negative valuations: Check for negative EBITDA/revenue or unrealistic assumptions
- Missing data: Some companies may have limited financial data available
- API timeouts: Retry the script if data fetching fails
Important: When you change a ticker symbol and run the scripts:
- β NEW files are created with the new symbol name
- β Existing files are NOT updated
- π Look in the output/ folder for files starting with your new symbol
- π Read the Excel Usage Guide for detailed instructions
- π§ Check
examples/analyze_stock.pyfor usage examples - π Review generated Excel files for formula references
- π Run
python verify_setup.pyto test your installation
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-model) - Commit your changes (
git commit -am 'Add new valuation model') - Push to the branch (
git push origin feature/new-model) - Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
These models are for educational and analysis purposes only. Always conduct thorough due diligence and consult with financial professionals before making investment decisions.