How to export a Wikipedia table to Excel or Google Sheets
Wikipedia has no “export to Excel” button, and its tables are packed with flags, links, merged cells and footnote markers. Here are three ways to get one into a spreadsheet.
Why Wikipedia tables are messy
- Cells can span several rows or columns (
rowspan,colspan). - Flag icons and other images sit inside cells.
- Values carry markers like
[1]or[a]and sometimes hidden sort keys. - An article can hold many tables plus an infobox, so “the third table” is hard to count.
Method 1: Google Sheets IMPORTHTML
=IMPORTHTML("https://en.wikipedia.org/wiki/…","table",2) loads the second table. Catches: you have to guess the index because infoboxes count, footnote markers still come through, and it is a live link, so the data shifts when the article is edited.
Method 2: Excel → Data → Get Data → From Web
Paste the article URL and Excel lists Table 0, Table 1… in the Navigator. Catches: the tables are unlabelled, so you preview each one, and footnote and merged-cell clean-up is still manual.
Method 3: A browser extension
CleanTable lets you right-click the table you want and paste it by columns: images are dropped, links become text, hidden rows are skipped and merged cells are expanded.
Removing footnote markers
Markers stay in the cell text, but they are easy to strip:
- Google Sheets: Edit → Find and replace → Search using regular expressions → find
\[\w+\]→ replace with nothing. - Excel (recent Microsoft 365):
=REGEXREPLACE(A2,"\[\w+\]","").
Which one should you use?
Use IMPORTHTML if you want a live link to a stable page, Excel From Web if you want refreshable queries in a workbook, and an extension if you want the exact table you see, once, cleanly.