A spreadsheet supports formulas in cells that trigger queries of a data source. The parameters for queries can include or depend on values in other cells in the spreadsheet. Thus, the precise query submitted to the data source is dynamic, being dependent on the data and formulas in the spreadsheet. Furthermore, on receiving the query results, they are added to cells in the spreadsheet, which can be parameters for other queries defined in other cells. Changing the value of a single cell can automatically trigger an update of an arbitrarily deep hierarchy of calculations that can include an arbitrary number of data source queries.