Revenue Growth Rank
Calculate the weighted revenue growth rank of Lakonishok, Shleifer and Vishny (1994): how a company’s revenue growth ranked among the Toolkit’s companies over the past years, the latest weighted most.
Lakonishok, Shleifer and Vishny find that investors extrapolate past growth: companies with a long record of high sales growth (glamour stocks) earn lower returns afterwards than those with low growth (value stocks).
The formula is as follows:
\[\text{Revenue Growth Rank} = \frac{\sum_{k=0}^{n - 1} (n - k) \cdot \text{Rank}_{t-k}}{\sum_{k=1}^{n} k}\]Rank(t-k) is the percentile rank of the revenue growth k years earlier among the companies and n the number of years. With \(n = 5\) the weights are 5, 4, 3, 2 and 1 over 15. The percentile ranks run from 1 / N to 1 for N companies with a growth that year. A company without a growth in one of the years is NaN. With quarterly data the growth is that of the trailing twelve months over a year earlier, ranked every quarter.
- Lakonishok, J., A. Shleifer and R. W. Vishny (1994). “Contrarian Investment, Extrapolation, and Risk.” The Journal of Finance, 49(5), 1541-1578.
Also known as: MeanRankRevGrowth, weighted sales growth rank, past sales growth rank.
Example · AAPL, MSFT, KO, XOM, 2 more · 2018 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_revenue_growth_rank:
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL", "MSFT", "KO", "XOM", "NVDA", "PG"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2018-01-01",
end_date="2025-12-31",
)
toolkit.ratios.get_revenue_growth_rank(years=3)
Or, with the Finance Toolkit MCP set up, ask an AI assistant such as Claude or ChatGPT:
How did the revenue growth of Apple, Microsoft, Coca-Cola, ExxonMobil, Nvidia and Procter & Gamble rank against each other over three-year windows from 2018 to 2025?
Which returns:
| Item | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 |
|---|---|---|---|---|---|---|---|---|
| AAPL | 0.5833 | 0.6111 | 0.6389 | 0.5833 | 0.4444 | 0.3611 | 0.5667 | |
| KO | 0.5000 | 0.4722 | 0.4167 | 0.5000 | 0.6111 | 0.6667 | 0.6333 | |
| MSFT | 0.7500 | 0.8333 | 0.6944 | 0.7222 | 0.7778 | 0.8333 | 0.9167 | |
| NVDA | 0.6667 | 0.7778 | 0.8889 | 0.5833 | 0.7222 | 0.8611 | ||
| PG | 0.5000 | 0.5278 | 0.3611 | 0.3056 | 0.3889 | 0.4722 | 0.4500 | |
| XOM | 0.5000 | 0.2778 | 0.5000 | 0.8056 | 0.5556 | 0.3056 | 0.1833 |
6 rows
Parameters
get_revenue_growth_rank accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
years | int | The number of years n the ranks are weighted over. Defaults to 5. | 5 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
growth | bool | Whether to calculate the growth of the ratios. Defaults to False. | True |
lag | int | list[int] | The lag to use for the growth calculation. Defaults to 1. | 4 |
compound | bool | Whether the growth is the compound annual growth rate over the lag (e.g. lag=5 for the five-year CAGR) instead of the total change. Defaults to False. | False |
standardize | bool | Whether to standardize (Z-Score) the result. When combined with growth=True, standardizes the growth values instead of the raw values. Defaults to False. | True |
transform | str | list[str] | None | Time series steps applied in order, such as “sma:12” (moving average), “ema:12”, “std:12”, “zscore:60”, “percentile:120”, “yoy”, “pct_change:3,annualize:3”, “log”, “diff”, “cumsum” or “hp_trend” and “hp_cycle” (Hodrick-Prescott), before growth. A window needs that many periods of history, so the first periods can be empty. Defaults to None. | None |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
References
- Paper Lakonishok, J., A. Shleifer and R. W. Vishny (1994). “Contrarian Investment, Extrapolation, and Risk.” The Journal of Finance, 49(5), 1541-1578.