API Reference
Cmdlet
Set-OfficeExcelFormula
Sets a formula in a worksheet cell.
Remarks
Supports A1 addresses or row/column coordinates in the Excel DSL.
Examples
Write a SUM formula.
PS>
ExcelSheet 'Data' { Set-OfficeExcelFormula -Address 'C2' -Formula 'SUM(A2:B2)' }
Stores the formula in cell C2.
Common Parameters
This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.
For more information, see about_CommonParameters.
Syntax
Set-OfficeExcelFormula [-Column <Int32>] -Formula <String> [-PassThru] [-Row <Int32>] [<CommonParameters>]#Parameter set:
CoordinatesParameters
- Column Int32
- 1-based column index.
- Formula String
- Formula text (without leading =).
- PassThru SwitchParameter
- Emit the object created or changed by the command.
- Row Int32
- 1-based row index.
Set-OfficeExcelFormula [-Address <String>] -Formula <String> [-PassThru] [<CommonParameters>]#Parameter set:
AddressParameters
- Address String
- A1-style cell address (e.g., A1, C5).
- Formula String
- Formula text (without leading =).
- PassThru SwitchParameter
- Emit the object created or changed by the command.