API Reference
Command
Set-OfficeExcelFormula
Sets a formula in a worksheet cell.
Remarks
Sets a formula in a worksheet cell.
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 <Nullable`1>] -Formula <String> [-Row <Nullable`1>] [<CommonParameters>]#Parameter set:
CoordinatesParameters
- Column Nullable`1
- 1-based column index.
- Formula String
- Formula text (without leading =).
- Row Nullable`1
- 1-based row index.
Outputs
System.Object
Set-OfficeExcelFormula [-Address <String>] -Formula <String> [<CommonParameters>]#Parameter set:
AddressParameters
- Address String
- A1-style cell address (e.g., A1, C5).
- Formula String
- Formula text (without leading =).
Outputs
System.Object