Get the value of a statistical variable at a given place and time.
=DCGET(dcids, variable, date)
dcids- place DCIDs as a single value, a row, or a column
variable- The StatisticalVariable to get
date- The dates to observe in ISO 8601 format (e.g. 2017, “2017”, “2017-12”) or as a Google sheets date value. This can be a single value, a row, or a column.
date is optional. If it’s not specified, the function returns the latest observation of the variable.
The value of the variable at those places on the specified date (or on the latest available date, if no date is specified).
It’s best to minimize the number of function calls to
DCGETby using a single call to get a variable for a row/column of places and/or a column/row of times. This is because a spreadsheet will make one call to a Google server per custom function call. If your sheet contains thousands of separate calls to
DCGET, expect it to be slow.
You can find a list of StatisticalVariables with human-readable names here.
Get the total population of Hawaii in 2017.
=DCGET("geoId/15", "Count_Person", 2017)
Get the population of multiple places with a single function call.
Get the population of a single place in multiple years.
Get the median age of multiple places in multiple years.
With places as a column and dates as a row:
With places as a row and dates as a column: