Tabellab

Government Revenue & Spending by Category, as % of GDP

Lesson 1 of 20Lab

All lessons

You are not signed in — the lab works, but your progress is not saved. Sign up

Lesson 1 of 20 is free. Unlock all 20 hands-on labs, the final exam and your certificate.

Buy course — €9.90
Loading the spreadsheet…

Why every budget conversation starts with "% of GDP"

A finance ministry announces that it will spend 44 billion on education next year. Is that a lot? For a country with an economy of 200 billion it would be enormous. For one of 4 trillion it would be tiny. Raw amounts in a budget are almost meaningless until you put them next to the size of the economy that pays for them. That is why economists, rating agencies, journalists and international organisations almost always describe government revenue, spending, deficits and debt as a percentage of gross domestic product (GDP).

This first lesson is written for students of economics and public policy, analysts in ministries, municipalities and think tanks, journalists who cover budgets, and anyone who wants to read a budget statement without getting lost in billions. You do not need advanced Excel. If you can type a formula such as =B13/B21 and copy it down a column, you can do everything here.

Throughout the course we follow the fictional Republic of Valdoria. Its general government collects 348 billion USD, spends 370 billion and has a nominal GDP of 820 billion. The spreadsheet in the lab above holds exactly these numbers, so you can check every figure in this article in the live sheet. All figures are invented for teaching. They are realistic in shape, but they do not describe any real country.

The core concept: three ratios that tell the budget story

Almost every first analysis of a government budget uses the same three building blocks. Once you can compute them, you can read the fiscal tables of most budget documents and international databases.

  1. Each line as % of GDP. Amount divided by nominal GDP. Personal income tax of 78 bn in an economy of 820 bn is 78 / 820 = 9.51% of GDP. This lets you compare years (when GDP grows) and countries (when economies differ in size).
  2. Each line as a share of the total. Amount divided by total spending (or total revenue). Health spending of 62 bn out of 370 bn is 16.76% of the budget. Shares describe the composition of the budget and always add up to 100%.
  3. Summary ratios. Total revenue as % of GDP (the revenue ratio), total spending as % of GDP (the spending ratio), and the tax ratio, which in this lab covers the taxes in rows 2 to 5 only.

The difference between the first two ratios is the single most common source of confusion. Both divide one line by something, and both produce a percentage. But they answer different questions. % of GDP answers "how big is this compared with the economy?" Share of total answers "how much of the budget goes here?" If health rises from 7.6% to 8.0% of GDP while the whole budget grows even faster, its share of the total can actually fall. A good analyst always says which denominator they are using.

Revenue normally comes from four groups: taxes on income and profits (personal and corporate income tax), taxes on goods and services (VAT, sales taxes, excise duties and customs), social contributions paid by employers and employees into pension, health or unemployment schemes, and other revenue such as fees, fines, rents and dividends from state-owned companies. Spending is usually classified by function, following the international COFOG classification (Classification of the Functions of Government), with groups such as social protection, health, education, defence, public order and safety, economic affairs and general public services.

The definition of the tax ratio varies. In this lab it covers taxes in rows 2 to 5 only. Many international tax-to-GDP comparisons also include social contributions. Before you compare your number with a published one, check which definition the source uses.

Worked example: Valdoria's budget, line by line

Start with revenue. Each line is divided by GDP in cell B21. Because GDP stays the same for every row, the formula uses an absolute reference, $B$21, so that it can be copied down without the denominator sliding to an empty cell.

RowRevenue lineUSD bn% of GDP (C)Formula in C
2Personal income tax789.51%=B2/$B$21
3Corporate income tax344.15%=B3/$B$21
4VAT & sales taxes9211.22%=B4/$B$21
5Excise & customs212.56%=B5/$B$21
6Social contributions9611.71%=B6/$B$21
7Other revenue273.29%=B7/$B$21
8Total revenue34842.44%=B8/$B$21
Valdoria revenue, 2026 (fictional figures). Taxes in rows 2 to 5 add up to 225 bn, a tax ratio of 27.44% of GDP.

Two things stand out. First, VAT and social contributions are each larger than personal income tax. That is typical of many economies that rely on broad consumption taxes and payroll-based social insurance. Second, the tax ratio, =SUM(B2:B5)/B21, is 225 / 820 = 27.44% of GDP. If you include social contributions, the ratio jumps to 321 / 820 = 39.15%. Same country, same year, two very different-looking numbers. This is exactly why the definition matters.

Now spending. Here you calculate both ratios: column C divides by GDP, column D divides by total spending in B19.

RowSpending functionUSD bn% of GDP (C)Share of total (D)
11Social protection14217.32%38.38%
12Health627.56%16.76%
13Education445.37%11.89%
14Defence151.83%4.05%
15Public order & safety141.71%3.78%
16Economic affairs384.63%10.27%
17Interest242.93%6.49%
18General services313.78%8.38%
19Total spending37045.12%100.00%
Valdoria spending by function. Column C uses =B11/$B$21, column D uses =B11/$B$19, both copied down to row 18.

Social protection (pensions, unemployment benefits, family and disability benefits) absorbs 38.38% of all spending and 17.32% of GDP. That pattern is common in advanced economies with ageing populations. Interest on public debt is 24 bn, or 2.93% of GDP. It is worth watching, because interest is spending that buys no new services. In lesson 3 of this course you will see how interest, growth and the primary balance together decide whether a debt ratio rises or falls.

Finally, compare the totals. Revenue is 42.44% of GDP, spending 45.12%. The gap, 348 − 370 = −22 bn, is a deficit of 2.68% of GDP (=(B8-B19)/B21). If you remove interest from spending, the primary balance is 348 − (370 − 24) = +2 bn, a small primary surplus of 0.24% of GDP. You will build that distinction properly in the next lesson.

Reading the numbers like an analyst

A table of ratios is only the start. The value comes from the questions you ask of it. Here are four that budget analysts ask almost automatically when they see a new set of figures.

  1. Is the budget balanced, and by how much? Compare the revenue ratio with the spending ratio. A gap of one or two percent of GDP is common. A persistent gap of five percent or more usually means debt is rising quickly, unless growth is strong.
  2. Where is the money concentrated? The top three functions in Valdoria (social protection, health and education) take 67% of all spending. Any serious plan to cut or expand the budget has to deal with these three, because the small items cannot move the total much.
  3. How much is committed in advance? Interest and most social benefits are set by past borrowing and existing law. They are hard to change in a single budget year, so the room for manoeuvre is smaller than the total suggests.
  4. How stable is the revenue base? Corporate income tax tends to swing more with the business cycle than VAT or social contributions. A budget that leans heavily on profits taxes can be hit hard in a recession, which is a topic you will meet again in the lesson on tax buoyancy.

None of these questions needs advanced maths. They need clean ratios with clear denominators, which is exactly what the lab trains. Once the table is right, a chart turns it into a picture that a minister, a reader or an examiner can grasp in a few seconds.

Valdoria spending by function, 2026 (USD bn)050100150Social protection142 (38.4%)Health62 (16.8%)Education44 (11.9%)Economic affairs38 (10.3%)General services31 (8.4%)Interest24 (6.5%)Defence15 (4.1%)Public order & safety14 (3.8%)
Figure 1. Valdoria spending by function, sorted largest first, with each function's share of total spending in brackets. A sorted bar chart is the chart the lab asks you to build.

Revenue vs spending, % of GDP (Valdoria 2026)0%10%20%30%40%50%RevenuePIT9.5CIT4.1VAT11.2Soc. contr.11.7Other3.342.4%SpendingSoc. prot.17.3Health7.6Educ.5.4Econ.4.6Gen.3.845.1%Deficit 22 bn = 2.7% of GDPEach block is one revenue source or spending function as % of nominal GDP (USD 820 bn).
Figure 2. The same budget as % of GDP. Revenue (top) is 42.4% of GDP, spending (bottom) 45.1%. The peach gap is the overall deficit of 2.7% of GDP.

How to do it in Excel, step by step

The lab above runs in the browser, but every step works the same way in Microsoft Excel or Google Sheets. Here is the full sequence with menu paths and shortcuts.

  1. Enter the data: labels in column A, amounts in USD bn in column B, GDP in B21. Put totals in B8 (=SUM(B2:B7)) and B19 (=SUM(B11:B18)). Shortcut: select the cell below a column of numbers and press Alt+= (Windows) or Cmd+Shift+T (Mac) for AutoSum.
  2. In C2 type =B2/B21, then click into B21 in the formula bar and press F4 (Mac: Cmd+T) until it reads $B$21. Press Enter.
  3. Select C2:C7 and press Ctrl+D to fill down. Repeat with C11:C18, starting with =B11/$B$21 in C11.
  4. In D11 type =B11/$B$19 and fill down to D18. Check: the shares must add up to 100%. Type =SUM(D11:D18) in D19 as a control total.
  5. In C22 calculate the tax ratio: =SUM(B2:B5)/B21.
  6. Format columns C and D as percentages: Home > Number > Percent Style or Ctrl+Shift+%, then use Increase Decimal once or twice.
  7. Sort the spending block for the chart: select A11:B18, then Data > Sort, sort by column B, order Largest to Smallest. In Excel 365 you can leave the source unsorted and build a sorted copy with =SORTBY(A11:B18,B11:B18,-1).
  8. Insert the chart: select the sorted range, Insert > Charts > Bar > Clustered Bar. Excel draws horizontal bars from the bottom up, so to show the largest item at the top, right-click the vertical axis, choose Format Axis and tick Categories in reverse order.
  9. Click the chart title and type something specific, for example "Valdoria spending by function 2026 (USD bn)". Delete the legend, because one series needs none. Add data labels with the + button next to the chart (Windows) or Chart Design > Add Chart Element.
Write the denominator in the column heading: "% of GDP" or "Share of total spending". It costs two seconds and prevents the most common misreading of budget tables, both by you and by anyone who receives your file.

Government budget analysis in Excel: revenue and spending as a percentage of GDP
Public finance in a spreadsheet: every ratio in this course is a simple formula you can audit cell by cell.

Common mistakes and how to spot them

  • Dividing by the wrong total. =B13/B19 gives the share of spending (11.89%), not % of GDP (5.37%). Spot it: % of GDP values in a spending column must add up to the spending ratio (45.12%), not to 100%.
  • Forgetting the dollar signs. If C11 is =B11/B21 and you copy it down, C12 becomes =B12/B22, which divides by an empty cell and shows #DIV/0!. Spot it: errors or wildly large percentages from the second row on.
  • Mixing up tax definitions. Including social contributions or other revenue in the tax ratio changes it from 27.44% to 39.15% or 42.44%. Spot it: write the row range in the label, as the lab does.
  • Mixing nominal and real figures. Budget amounts are in current prices, so divide them by nominal GDP. Dividing by real GDP (in constant prices) distorts the ratio, especially when inflation is high.
  • Mixing levels of government. Central government and general government (central, regional, local and social security funds together) can differ a lot. Never put a central-government spending figure over a general-government revenue figure.
  • Using a pie chart for eight functions. Thin slices are almost impossible to compare. A sorted bar chart reads in seconds.
  • Not sorting. An unsorted bar chart forces the reader to hunt for the biggest items. Sort largest first unless the categories have a natural order.

Quick reference: Excel functions and shortcuts used

Function or shortcutWhat it does hereExample
SUMAdds a range of revenue or spending lines=SUM(B11:B18)
$B$21 (absolute reference)Keeps GDP fixed when you copy a formula down=B11/$B$21
F4 (Windows) / Cmd+T (Mac)Toggles a reference between relative and absoluteB21 becomes $B$21
Ctrl+DFills the formula from the top cell down a selectionSelect C11:C18, press Ctrl+D
Ctrl+Shift+% Applies percentage formatShows 0.0537 as 5%
SUMPRODUCTWeighted totals, for example a weighted average tax rate=SUMPRODUCT(B2:B5,C2:C5)
RANK.EQRanks a spending line within the list=RANK.EQ(B13,$B$11:$B$18)
SORTBY (Excel 365)Returns the list sorted by amount, for a dynamic chart=SORTBY(A11:B18,B11:B18,-1)
Insert > Charts > BarInserts a horizontal bar chartClustered Bar for 8 functions

Real-world uses

  • Reading a national budget statement. Convert the headline amounts into % of GDP so you can compare this year with the past five, and see whether a "record" spending figure is really a record once the economy's growth is taken into account.
  • Comparing countries. International databases publish revenue and spending by function as % of GDP. With the same three ratios you can place your own country next to its neighbours and ask why health or social protection is larger or smaller.
  • Municipal and regional budgets. A city has no GDP, but the same logic works with a different denominator, such as total local income, the number of residents (spending per head) or the total budget (shares).
  • Journalism and fact-checking. When a politician says spending has "exploded", the share and % of GDP columns show quickly whether that is true, and in which function.
  • Exam and coursework. Public economics courses regularly ask for exactly this table: tax structure, functional spending and the balance, expressed relative to GDP.

What you will build in the rest of this course

Lesson 1 is free. The other 19 lessons are part of the full course, which you unlock with a one-time payment of $9.90. Each one is a hands-on lab with the same Valdoria data, so your skills build on each other.

Primary vs Overall Budget Balance. You separate interest from the rest of the budget and see why a country can run a deficit overall while its primary balance is in surplus, and why markets and fiscal rules look at both.

Debt Dynamics: d(t) = d(t−1)·(1+r)/(1+g) − pb. You build the core debt equation in a sheet and project Valdoria's debt ratio year by year, testing how interest rates, growth and the primary balance push it up or down.

The Debt-Stabilising Primary Surplus. You solve for the primary balance that keeps the debt ratio constant, and see how sensitive it is when the gap between interest and growth changes.

Progressive Income Tax: Marginal vs Average Rates with a Bracket Table. You compute the tax due across brackets with a lookup table and chart why the average rate always lags behind the marginal rate.

Tax Buoyancy, Tax Elasticity & a Revenue Forecast. You measure how strongly revenue reacts to GDP growth, separate policy changes from automatic growth, and forecast next year's tax take.

Public Investment Appraisal: Social NPV & the Discount Rate. You appraise a public project with a social NPV, test different discount rates and see how the choice of rate can flip a decision.

Budget Variance Analysis & a Fiscal Rules Check. You compare the outturn with the budget, explain the variances and test the result against deficit and debt rules, which is the kind of check budget offices run every year.

Summary

Government budgets only make sense relative to the economy. Divide each line by nominal GDP to compare across time and countries, divide by the budget total to see its composition, and always state which tax definition you use. For Valdoria that gives revenue of 42.44% of GDP, spending of 45.12%, a tax ratio of 27.44% and a deficit of 2.68% of GDP, with social protection as by far the biggest function.

Now scroll up and try the lab: fill C2:C7 and C11:D18, calculate the tax ratio in C22 and insert a sorted bar chart. The Coach checks each step and explains what went wrong if a formula divides by the wrong cell.

Frequently asked questions

How do you calculate government spending as a percentage of GDP?

Divide the spending amount by nominal GDP for the same year and format the result as a percentage. In Excel that is for example =B13/$B$21, with the dollar signs keeping GDP fixed when you copy the formula down.

What is the difference between % of GDP and share of total spending?

% of GDP compares a budget line with the size of the economy. Share of total compares it with the whole budget and all shares add up to 100%.

What is the tax-to-GDP ratio?

It is total tax revenue divided by GDP. Definitions differ: some include social contributions and some do not, so always check which taxes a published figure covers before comparing.

What is COFOG?

COFOG is the Classification of the Functions of Government, an international standard that groups public spending by purpose, such as social protection, health, education and defence. It makes spending comparable across countries.

Should I use nominal or real GDP for budget ratios?

Use nominal GDP. Budget amounts are in current prices, so the denominator should be in current prices too.

Which chart is best for government spending by function?

A horizontal bar chart sorted from the largest to the smallest item. It is much easier to read than a pie chart with many thin slices.

Keep going: Public Finance: Government Budgets, Deficits & Debt Sustainability

This free lab is lesson 1 of 20. Unlock the other 19 hands-on labs, the final exam and your certificate for a one-time €9.90.

  1. Primary vs Overall Budget Balance
  2. Debt Dynamics: d(t) = d(t−1)·(1+r)/(1+g) − pb
  3. The Debt-Stabilising Primary Surplus
  4. Progressive Income Tax: Marginal vs Average Rates with a Bracket Table
  5. Tax Buoyancy, Tax Elasticity & a Revenue Forecast
  6. Public Investment Appraisal: Social NPV & the Discount Rate
  7. Budget Variance Analysis & a Fiscal Rules Check
  8. Cyclically Adjusted & Structural Balance: Taking the Business Cycle Out
  9. A Consolidation Package: Static Yields, Multipliers & the Net Deficit Effect
  10. Gross Financing Needs: Deficits Plus Maturing Debt
  11. The Effective Interest Rate on Debt: Bond Portfolio & Refinancing at Market Rates
  12. Debt Stress Tests: Interest, Growth & Primary Balance Shocks
  13. An r–g Sensitivity Grid for the Debt Ratio
  14. Stock-Flow Adjustment: When Debt Moves Without a Deficit
  15. The VAT Gap: Theoretical VAT, Compliance Gap & Policy Gap
  16. Tax Expenditures: Revenue Forgone vs Revenue Gained by Repeal
  17. Fiscal Equalisation: Regional Capacity, Gaps & Transfer Grants
  18. A Spending Rule: Expenditure Ceilings vs Ministry Requests
  19. Final Project: Valdoria's Medium-Term Fiscal Dashboard

Buy course — €9.90 See the full course