Evotec

Project

PSWriteOffice

PSWriteOffice is an open-source PowerShell and .NET project with packages, release history, and technical documentation.

Stars 144
Forks 12
Open issues 16
PowerShell Gallery downloads 150,904
Release v0.2.0
Language: C# Updated: 2026-04-06

API Reference

Cmdlet

Set-OfficeExcelFormula

Namespace PSWriteOffice
Inputs
None
Outputs
System.Object

Sets a formula in a worksheet cell.

Remarks

Supports A1 addresses or row/column coordinates in the Excel DSL.

Examples

Authored help example

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: Coordinates

Parameters

Column Nullable`1 optionalposition: namedpipeline: False
1-based column index.
Formula String requiredposition: namedpipeline: False
Formula text (without leading =).
Row Nullable`1 optionalposition: namedpipeline: False
1-based row index.

Outputs

System.Object

Set-OfficeExcelFormula [-Address <String>] -Formula <String> [<CommonParameters>]
#
Parameter set: Address

Parameters

Address String optionalposition: namedpipeline: False
A1-style cell address (e.g., A1, C5).
Formula String requiredposition: namedpipeline: False
Formula text (without leading =).

Outputs

System.Object