Overview
A collector pulls five World Bank indicators daily: total population (SP.POP.TOTL), annual growth (SP.POP.GROW), urban population share (SP.URB.TOTL.IN.ZS), population density (EN.POP.DNST) and life expectancy at birth (SP.DYN.LE00.IN). It stores one record per country per year from 1960 and keeps the newest year as the latest record.
`country` accepts ISO 3166 alpha-2 or alpha-3 codes; two-letter codes are mapped to three-letter ones before lookup, and Kosovo is handled as XK. Without `year` you get the newest stored year. `year` (paid) must be between 1960 and the current year, otherwise the request is rejected with a 400, and a year with no record returns a 404.
The response always wraps the figures in a `historical` array with one entry, and `count` is 1. `population` is the raw count and `populationFormatted` its readable form. `growthRate` is the year-on-year change in percent and can be negative. `density` is people per square kilometre of land and `urbanPercent` is the urban share in percent, both rounded to two decimals. Indicators publish on different schedules, so the newest year often has a population count before density or life expectancy are released; those fields are null until the World Bank fills them, and a reported zero is kept as zero rather than treated as missing.
`worldRank` ranks the country by `population` among the countries and territories that report a population that year (about 217); World Bank regional, income and lending aggregates are excluded. Ranking is per year, so a historical lookup returns the rank for that year. Ties share a rank and the next rank is skipped. `rankedCountries` is the number ranked, and `worldPercent` is the population divided by the World Bank world total (`WLD`) for the year, as a percentage to four decimals; the world total also counts Taiwan, which the World Bank does not list separately, so the shares of all ranked countries add up to slightly under 100. All three are null when the year has no ranking or the code is not a ranked country.
Live Test Population Data Source →
Formula
One function covers the whole catalog: the first argument names the source, the next are its inputs, and the field after them says which single value lands in the cell. Formulas covers the grammar that applies to all of them.
=VERVE("population", A2, "countryName")=VERVE.CALL("population", A2, "countryName")A2 holds the country you are looking up. Drag the formula down and each row resolves on its own.
With literal values
Nothing has to come from a cell — typed values work the same way.
=VERVE("population", "US", "countryName")=VERVE.CALL("population", "US", "countryName")Inputs
Required inputs are positional, in the order below, followed by the field. Everything else is passed as a "name", value pair after that — the same shape as SUMIFS. Premium inputs are accepted on every plan but only take effect on plans that include them.
| Input | Type | Where it goes | Description |
|---|---|---|---|
countryRequired | string | argument 2 (A2) | ISO 2 or 3-letter country code (e.g., US, USA, GB, GBR) length 2–3 |
yearOptionalPremium | integer | "year", value | Specific year to retrieve data for (1960-present). Returns latest if not specified. range 1960–2030 |
Passing an option
=VERVE("population", A2, "countryName", "year", 2023)=VERVE.CALL("population", A2, "countryName", "year", 2023)What lands in your sheet
The field — the argument after the inputs — is what makes the formula resolve to one cell. Its value is a dot-path from the table below, so swapping it is how you pull a different value — one formula per column.
Seeing everything at once
Leave the field out and the formula returns the whole response instead: two columns, field name on the left and value on the right, spilling from the cell you typed in.
=VERVE("population", A2)=VERVE.CALL("population", A2)The second row's table would land on top of the first's, and every cell after the first reads #REF! (#SPILL! in Excel). Keep one per sheet, or name a field, and leave the cells below and to the right empty.
Response fields
Paths are relative to data. Each one is exactly what the field argument accepts, so swapping it is how you pull a different value into a cell. On a plan without a Premium field the cell reads #PREMIUM(field) rather than a value, so a locked field never looks like a real answer.
| Use as the field | Type | Example cell value | Description |
|---|---|---|---|
country | string | US | ISO 2-letter country code for the country |
countryName | string | United States | Full name of the country in English |
year | number | 2025 | Year of the population data retrieved |
count | number | 1 | Number of historical records returned |
historical | array[1] | Population figures for the requested year (one entry) | |
historical.0.year | number | 2025 | Year the figures in this entry describe |
historical.0.populationPremium | number | 341784857 | Total population count for the country |
historical.0.populationFormattedPremium | string | 341.78 million | Population count in human-readable format |
historical.0.growthRatePremium | number | 0.52 | Annual population growth rate as percentage |
historical.0.urbanPercentPremium | number | 80.19 | Percentage of population living in urban areas |
Filling a whole column
Both platforms make one batched call for a column rather than one request per cell, and both cost the same — 2 credits per row looked up. How you write it differs, because the two runtimes batch at different points.
=VERVE("population", A2:A100, "countryName")In Google Sheets, give the arguments ranges and the answers spill down from the cell you typed in. Custom functions there run synchronously and in isolation, so dragged cells cannot be coalesced — the range form is how a column becomes one call. The field is required here: a per-row two-column table has nowhere to spill. Use a full column per input (A2:A100, not A2) — a single-cell reference is read as row 1 only and the rest of the column comes back blank.
In Excel, type the formula once and fill down — no range form and none needed, because its runtime is asynchronous and the add-in coalesces the calls a fill produces into a single batched request. Do not hand VERVE.CALL a range: Excel flattens it into positional arguments, so A2:A100 arrives as a hundred separate arguments and the cell reads #ERR rather than filling.
Either way, column A holds your country values and the answers land beside them, one row each, blank rows skipped.
When a cell doesn't fill
A failed lookup returns readable text starting with #ERR rather than a spreadsheet error, because Excel cannot show a custom message on a real error — you would get a bare #VALUE! with no reason. The trade-off is that IFERROR() will not catch it; test with LEFT(cell, 4) = "#ERR" instead. Error handling covers the rest.
| Cell reads | What happened |
|---|---|
#ERR Not connected | No API key saved. Open the side panel and connect your account. |
#ERR Replace <name> with a cell or value | A preview formula was copied as-is. Swap the placeholder for a cell reference. |
#ERR No "x" in population | An option name this source does not take. The message lists the ones it does. |
#ERR No data point "…" | The field path is not in the response. Check it against the table above. |
#PREMIUM(field) | The field exists but your plan does not include it. |
#ERR Out of credits | The cycle's credits are spent. Usage resets on your billing date. |
Before the formula works
The add-in reads the API key you saved once in the side panel — the key never goes in the formula, so a shared sheet does not leak it and a collaborator without access simply sees the last calculated values.
- Install the add-in for Google Sheets or Excel.
- Open the side panel and sign in, or paste a key from your dashboard.
- Type the formula above into any cell.
Use cases
- Market Expansion Sizing
- When evaluating entry into emerging markets, retail planners pull total population and urban percentage to gauge addressable customer density.
- Demographic Trend Modeling
- Academic research tools query historical growth rates and life expectancy across decades to model regional aging patterns.
- Broadband Network Planning
- Telecom planners cross-reference population density and urban shares to prioritize where to deploy new broadband fiber networks.
- Sovereign ESG Scoring
- To assess national health and development indicators, sovereign ESG platforms fetch country life expectancy and population growth figures.
Other ways to use Population Data
Set up Population Data on VerveSheets, or reach the same source a different way. Your VerveSheets account and credits work on all of them — one key, one balance.
Related
More in Finance: