# US 2020/0394358 A1 · Automatic translation of spreadsheets into scripts

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2020/0394358 A1
- Document ID: US20200394358A1
- Status: Published application
- Kind: A1
- Application number: 17/008,405
- Filed: 2020-08-31
- Published: 2020-12-17
- Earliest claimed: 2017-03-02
- Assignees: Palantir Technologies Inc.
- Applicants: Palantir Technologies Inc.
- Inventors: Eliot Ball; Dustin Janatpour; Nicholas White
- Web page: https://patentgrep.com/patent/US20200394358A1

## CPC

- G06F 40/18: of spreadsheets (form-filling G06F40/174)
- G06F 8/40: Transformation of program code
- G06F 8/427: {Parsing}
- G06F 40/103: Formatting, i.e. changing of presentation of documents (automatic justification G06F40/189; automatic line break hyphenation G06F40/191)
- G06F 40/177: of tables; using ruled lines
- G06F 40/205: Parsing
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Systems and methods are provided for automatically translating one or more electronic spreadsheets into scripts. One or more electronic spreadsheets containing data arrays and formula arrays may be accessed. The electronic spreadsheet(s) may implement various logic using the data arrays and the formula arrays. The range(s) of the formula arrays may be determined. The range(s) of the data arrays may be determined based on the range(s) of the formula arrays. Conversion ranges may be determined based on the range(s) of formula arrays and the range(s) of data arrays. One or more dependencies between the conversion ranges may be determined and used to generate source code modeling the logic implemented by the electronic spreadsheet(s).

## Claims

### Claim 1

A method being implemented by a computing system including one or more physical processors and storage media storing machine-readable instructions, wherein the method is performed using the one or more processors, the method comprising:
accessing one or more electronic spreadsheets, the one or more electronic spreadsheets containing one or more data arrays and one or more formula arrays, wherein the one or more electronic spreadsheets implement one or more logic using the one or more data arrays and the one or more formula arrays;
determining one or more ranges of the formula arrays by identifying cells having a same formula with cell references incrementing by a value of one between adjacent cells;
determining one or more ranges of the data arrays referenced by one or more formulas in the formula arrays;
determining conversion ranges based on the one or more ranges of the formula arrays and the one or more ranges of the data arrays;
determining one or more dependencies between the conversion ranges;
creating a dependency graph based at least partially on the dependency of the first conversion range on the second conversion range; and
generating source code based on the conversion ranges and the dependency graph, the source code modeling the one or more logic implemented by the one or more electronic spreadsheets, the conversion ranges being represented as respective blocks within the source code; and
integrating the generated source code directly into a processing pipeline so that the logic of the source code runs on values from different data sources.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
determining whether the generated source code is an equivalent to the one or more logic;
in response to determining that the generated source code is not an equivalent to the one or more logic, debugging the generated source code before the integrating of the generated source code.

### Claim 3 (depends on 1)

The method of claim 1, wherein a conversion range of the conversion ranges comprises a union of a range of a formula array and one or more of the data arrays referenced by the formula array.

### Claim 4 (depends on 1)

The method of claim 1, wherein the determining one or more dependencies comprises, for a conversion range of the conversion ranges:
determining the one or more ranges of the formula arrays in the conversion range and the one or more data arrays referenced by the formula arrays in the conversion range;
determining one or more other conversion ranges referenced by the one or more data arrays; and
determining that the conversion range depends on the one or more other conversion ranges.

### Claim 5 (depends on 4)

The method of claim 4, wherein the dependency graph illustrates the conversion ranges as topologically sorted and comprises arrows from the conversion range to each of the one or more other conversion ranges.

### Claim 6 (depends on 5)

The method of claim 5, wherein, in response to the one or more other conversion ranges not being dependent on one another, the dependency graph represents each of the one or more other conversion ranges as separate spaces arranged vertically with respect to one another.

### Claim 7 (depends on 1)

The method of claim 1, further comprising determining names for the conversion ranges based on cells containing a string above the conversion ranges; and
including the names for the conversion ranges in the dependency graph.

### Claim 8 (depends on 1)

The method of claim 1, wherein a conversion range of the conversion ranges comprises a union of a range of a formula array and one or more of the data arrays referenced by the formula array, merged with ranges of other formula arrays and data arrays that overlap with the formula array or the one or more of the referenced data arrays.

### Claim 9

A system comprising:
one or more physical processors; and
memory storing instructions that, when executed by the one or more physical processors, cause the system to perform:
accessing one or more electronic spreadsheets, the one or more electronic spreadsheets containing one or more data arrays and one or more formula arrays, wherein the one or more electronic spreadsheets implement one or more logic using the one or more data arrays and the one or more formula arrays;
determining one or more ranges of the formula arrays by identifying cells having a same formula with cell references incrementing by a value of one between adjacent cells;
determining one or more ranges of the data arrays referenced by one or more formulas in the formula arrays;
determining conversion ranges based on the one or more ranges of the formula arrays and the one or more ranges of the data arrays;
determining one or more dependencies between the conversion ranges;
creating a dependency graph based at least partially on the dependency of the first conversion range on the second conversion range; and
generating source code based on the conversion ranges and the dependency graph, the source code modeling the one or more logic implemented by the one or more electronic spreadsheets, the conversion ranges being represented as respective blocks within the source code; and
integrating the generated source code directly into a processing pipeline so that the logic of the source code runs on values from different data sources.

### Claim 10 (depends on 9)

The system of claim 9, wherein the instructions further cause the system to perform:
determining whether the generated source code is an equivalent to the one or more logic;
in response to determining that the generated source code is not an equivalent to the one or more logic, debugging the generated source code before the integrating of the generated source code.

### Claim 11 (depends on 9)

The system of claim 9, wherein a conversion range of the conversion ranges comprises a union of a range of a formula array and one or more of the data arrays referenced by the formula array.

### Claim 12 (depends on 9)

The system of claim 9, wherein the determining one or more dependencies comprises, for a conversion range of the conversion ranges:
determining the one or more ranges of the formula arrays in the conversion range and the one or more data arrays referenced by the formula arrays in the conversion range;
determining one or more other conversion ranges referenced by the one or more data arrays; and
determining that the conversion range depends on the one or more other conversion ranges.

### Claim 13 (depends on 12)

The system of claim 12, wherein the dependency graph illustrates the conversion ranges as topologically sorted and comprises arrows from the conversion range to each of the one or more other conversion ranges.

### Claim 14 (depends on 13)

The system of claim 13, wherein, in response to the one or more other conversion ranges not being dependent on one another, the dependency graph represents each of the one or more other conversion ranges as separate spaces arranged vertically with respect to one another.

### Claim 15 (depends on 9)

The system of claim 9, wherein the instructions further cause the system to:
determine names for the conversion ranges based on cells containing a string above the conversion ranges; and
include the names for the conversion ranges in the dependency graph.

### Claim 16 (depends on 9)

The system of claim 9, wherein a conversion range of the conversion ranges comprises a union of a range of a formula array and one or more of the data arrays referenced by the formula array, merged with ranges of other formula arrays and data arrays that overlap with the formula array or the one or more of the referenced data arrays.

### Claim 17

A non-transitory computer readable medium comprising instructions that, when executed, cause one or more processors to perform:
accessing one or more electronic spreadsheets, the one or more electronic spreadsheets containing one or more data arrays and one or more formula arrays, wherein the one or more electronic spreadsheets implement one or more logic using the one or more data arrays and the one or more formula arrays;
determining one or more ranges of the formula arrays by identifying cells having a same formula with cell references incrementing by a value of one between adjacent cells;
determining one or more ranges of the data arrays referenced by one or more formulas in the formula arrays;
determining conversion ranges based on the one or more ranges of the formula arrays and the one or more ranges of the data arrays;
determining one or more dependencies between the conversion ranges;
creating a dependency graph based at least partially on the dependency of the first conversion range on the second conversion range; and
generating source code based on the conversion ranges and the dependency graph, the source code modeling the one or more logic implemented by the one or more electronic spreadsheets, the conversion ranges being represented as respective blocks within the source code; and
integrating the generated source code directly into a processing pipeline so that the logic of the source code runs on values from different data sources.

### Claim 18 (depends on 17)

The non-transitory computer readable medium of claim 17, wherein the instructions further cause the system to perform:
determining whether the generated source code is an equivalent to the one or more logic;
in response to determining that the generated source code is not an equivalent to the one or more logic, debugging the generated source code before the integrating of the generated source code.

### Claim 19 (depends on 17)

The non-transitory computer readable medium of claim 17, wherein the determining one or more dependencies comprises, for a conversion range of the conversion ranges:
determining the one or more ranges of the formula arrays in the conversion range and the one or more data arrays referenced by the formula arrays in the conversion range;
determining one or more other conversion ranges referenced by the one or more data arrays; and
determining that the conversion range depends on the one or more other conversion ranges.

### Claim 20 (depends on 19)

The non-transitory computer readable medium of claim 19, wherein the dependency graph illustrates the conversion ranges as topologically sorted and comprises arrows from the conversion range to each of the one or more other conversion ranges.
