Get Formula
Retrieves formulas from a cell or range of cells in an Excel worksheet. Returns both the formulas and their evaluated values.
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 node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
Input
- Client Id - The client ID from the Connect node (optional if using direct credentials).
- Workbook Id - The workbook ID from Get Workbook or Create Workbook node.
- Worksheet Name - Name of the worksheet to read from. Default is "Sheet1".
- Cell/Range Address - Cell or range address to get formula from (e.g., A1, A1:B5).
Options
- Credentials - OAuth2 credentials (optional, alternative to using Client ID).
Output
- Formulas - 2D array of formulas from the specified range.
- Single Formula - Formula string from the first cell (for single-cell queries).
- Range Info - Range metadata including:
Address: Range addressRowCount: Number of rowsColumnCount: Number of columnsRowIndex: Starting row indexColumnIndex: Starting column index
Examples
Get Single Cell Formula:
// Input
Cell/Range Address: "D10"
// Output - single_formula
"=SUM(D2:D9)"
// Output - formulas
[["=SUM(D2:D9)"]]
Get Range Formulas:
// Input
Cell/Range Address: "C1:C5"
// Output - formulas
[
["=A1+B1"],
["=A2+B2"],
["=A3+B3"],
["=A4+B4"],
["=A5+B5"]
]
Check Formula Usage:
Get Workbook
→ Get Formula (check if cell has formula)
→ If formula exists, analyze it
→ Otherwise, get cell value
Formula Format
Formulas are returned exactly as entered in Excel:
- Start with
=sign - Use Excel function syntax:
=SUM(A1:A10) - Include cell references:
=A1+B1 - Show relative references:
=A1*2
Use Cases
- Audit formulas in worksheets
- Validate calculation logic
- Export formula definitions
- Check formula consistency
- Document worksheet calculations
Tips
- Empty cells or cells without formulas return empty strings
- For single cells, use Single Formula output for convenience
- For ranges, use Formulas output to get all formulas in a 2D array
- Range Info provides context about the queried range
Common Errors
ErrInvalidArg - "Range Address cannot be empty"
- Solution: Provide a valid cell or range address
ErrNotFound - "Range not found in worksheet"
- Solution: Verify the range address is valid and within worksheet bounds
ErrInvalidArg - "Workbook Id cannot be empty"
- Solution: Ensure you've called Get Workbook first