1. At a computer system including one or more processors and system memory, a method for converting a portion of a spreadsheet into a compilable function, the method comprising: an act of selecting one or more results cells in a page of a spreadsheet, the one or more results cells storing a corresponding one or more values representing the results of executing a plurality of formulas within the spreadsheet; an act of identifying values in a plurality of other cells related to the one or more results cells, the value in each of the plurality of other cells corresponding to execution of a combination of one or more of the plurality of formulas; an act of identifying additional data in further cells related to the values in the plurality of other cells, the additional data describing the values on the plurality of other cells; an act of using the identified additional data to generate local variables for use in a programming language, the local variables corresponding to the values in the plurality of other cells; and an act of generating a semantic tree representing a function from the plurality of formulas and the generated local variables, the semantic tree compilable into executable code configured to calculate the one or more values representing the results.