Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmeekers/42a3c13d968e66e3810dca3735d06d7f to your computer and use it in GitHub Desktop.
Save rmeekers/42a3c13d968e66e3810dca3735d06d7f to your computer and use it in GitHub Desktop.
Formula to import the number of internet users for a given country
/*
* Datasource: public Google Spreadsheet with internet user data:
* https://docs.google.com/spreadsheets/d/1uxPf0einHJxZqkTvXnFto0O8Q4Lxw9RBPKoBCV2idTE/edit
*
* In the example below, we expect one or more country codes (ISO 3166-1 alpha-2), separated by a pipe (|), in cell A2
*/
=
SUM(
QUERY(
IMPORTRANGE("1uxPf0einHJxZqkTvXnFto0O8Q4Lxw9RBPKoBCV2idTE";"Data!B:C");
"SELECT Col2 WHERE (Col1 matches '"&A2&"')"
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment