Skip to main content

Get Formula

Retrieves formulas from cells in a range and returns them as a dictionary mapping cell addresses to their formulas.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing the node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If ContinueOnError property is true, no error is caught when the project is executed even if the Catch node is used.

Input

  • File Descriptor - File descriptor of the Excel file. This is the identifier returned by the Open Excel node.
  • From Cell - Starting cell of the range (e.g., A1). Required when Range is "Specific-Range".
  • To Cell - Ending cell of the range (e.g., C10). Required when Range is "Specific-Range".

Output

  • Result - Dictionary object mapping cell addresses to their formulas. Cells without formulas have empty string values.
    • Example: {"A1": "=SUM(B1:B10)", "B1": "", "C1": "=A1*2"}

Options

  • Range - Whether to get formulas from all cells or a specific range:
    • Specific-Range - Get formulas from a specific range (requires From Cell and To Cell)
    • All-Range - Get formulas from all cells with data in the active sheet

Example

Getting all formulas in a sheet:

// File Descriptor: message.excel_fd
// Range: All-Range
// Output: {"A5": "=SUM(A1:A4)", "B5": "=AVERAGE(B1:B4)", "C1": "", ...}

Getting formulas from a specific range:

// From Cell: "D1"
// To Cell: "D10"
// Range: Specific-Range
// Returns formulas only from column D

Checking if cells contain formulas:

// After Get Formula, check if a formula exists:
// if (message.Result["A5"] !== "") {
// // Cell A5 has a formula
// }

Copying formulas to another location:

// 1. Get Formula from source range
// 2. Loop through results
// 3. Use Set Formula to recreate formulas in destination

Tips

  • Cells without formulas return empty strings in the result dictionary.
  • Formulas are returned in A1 reference style (e.g., =SUM(A1:A10)).
  • Cell addresses in the dictionary keys do not include dollar signs.
  • Use this to audit which cells contain calculations vs. static values.
  • For getting cell values (calculated results), use Get Range instead.

Common Errors

ErrorSolution
From Cell cannot be empty when Range is Specific-RangeProvide a starting cell address
To Cell cannot be empty when Range is Specific-RangeProvide an ending cell address
Range must be selectedChoose either Specific-Range or All-Range
Invalid File DescriptorEnsure the Open Excel node was executed first