API Reference

Cmdlet

Add-OfficeExcelSubtotalSummary

Aliases: ExcelSubtotals, ExcelSubtotalSummary
Namespace PSWriteOffice
Aliases
ExcelSubtotals ExcelSubtotalSummary
Inputs
OfficeIMO.Excel.ExcelDocument
Outputs
OfficeIMO.Excel.ExcelSubtotalResult

Adds grouped subtotal summary rows for a worksheet data range.

Remarks

Adds grouped subtotal summary rows for a worksheet data range.

Examples

Authored help example

Create subtotal rows below a grouped data range.

PS>


ExcelSheet Data { Add-OfficeExcelSubtotalSummary -GroupColumn Region -ValueColumn Sales -DataEndRow 20 }
        

Writes SUBTOTAL formulas below the data range and applies row outline metadata to each group.

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

Add-OfficeExcelSubtotalSummary [-DataEndRow <Nullable`1>] [-DataStartRow <Nullable`1>] [-Function <Sum>] [-GrandTotalLabel <String>] -GroupColumn <String> [-HeaderRow <Nullable`1>] [-HideDetailRows] [-LabelSuffix <String>] [-NoGrandTotal] [-NoHeader] [-NoOutline] [-OutlineLevel <Int32>] [-PassThru] [-SummaryStartRow <Nullable`1>] -ValueColumn <String[]> [<CommonParameters>]
#
Parameter set: Context

Parameters

DataEndRow Nullable`1 optionalposition: namedpipeline: False
Last data row. Defaults to the last row of the used range.
DataStartRow Nullable`1 optionalposition: namedpipeline: False
First data row. Defaults to the row after HeaderRow.
Function String optionalposition: namedpipeline: Falsevalues: 6
Subtotal function.
Possible values: Sum, Average, Count, CountNonBlank, Max, Min
GrandTotalLabel String optionalposition: namedpipeline: False
Label used for the optional grand total row.
GroupColumn String requiredposition: namedpipeline: Falsealiases: By, GroupBy
Group column as a 1-based index, column letter, or header name.
HeaderRow Nullable`1 optionalposition: namedpipeline: False
Header row that contains source labels. Defaults to the first row of the used range.
HideDetailRows SwitchParameter optionalposition: namedpipeline: False
Hide detail rows when applying outline metadata.
LabelSuffix String optionalposition: namedpipeline: False
Text appended to each group key in the subtotal label cell.
NoGrandTotal SwitchParameter optionalposition: namedpipeline: False
Skip writing a grand total row.
NoHeader SwitchParameter optionalposition: namedpipeline: False
Skip writing a summary header row.
NoOutline SwitchParameter optionalposition: namedpipeline: False
Skip applying outline metadata to detail rows.
OutlineLevel Int32 optionalposition: namedpipeline: False
Outline level used for grouped detail rows.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit OfficeIMO subtotal generation metadata.
SummaryStartRow Nullable`1 optionalposition: namedpipeline: False
First row for the generated summary block.
ValueColumn String[] requiredposition: namedpipeline: Falsealiases: AggregateColumn, AggregateColumns, ValueColumns
Value columns as 1-based indexes, column letters, or header names.

Outputs

OfficeIMO.Excel.ExcelSubtotalResult

Add-OfficeExcelSubtotalSummary [-DataEndRow <Nullable`1>] [-DataStartRow <Nullable`1>] -Document <ExcelDocument> [-Function <Sum>] [-GrandTotalLabel <String>] -GroupColumn <String> [-HeaderRow <Nullable`1>] [-HideDetailRows] [-LabelSuffix <String>] [-NoGrandTotal] [-NoHeader] [-NoOutline] [-OutlineLevel <Int32>] [-PassThru] [-Sheet <String>] [-SheetIndex <Nullable`1>] [-SummaryStartRow <Nullable`1>] -ValueColumn <String[]> [<CommonParameters>]
#
Parameter set: Document

Parameters

DataEndRow Nullable`1 optionalposition: namedpipeline: False
Last data row. Defaults to the last row of the used range.
DataStartRow Nullable`1 optionalposition: namedpipeline: False
First data row. Defaults to the row after HeaderRow.
Document ExcelDocument requiredposition: namedpipeline: True (ByValue)
Workbook to operate on outside the DSL context.
Function String optionalposition: namedpipeline: Falsevalues: 6
Subtotal function.
Possible values: Sum, Average, Count, CountNonBlank, Max, Min
GrandTotalLabel String optionalposition: namedpipeline: False
Label used for the optional grand total row.
GroupColumn String requiredposition: namedpipeline: Falsealiases: By, GroupBy
Group column as a 1-based index, column letter, or header name.
HeaderRow Nullable`1 optionalposition: namedpipeline: False
Header row that contains source labels. Defaults to the first row of the used range.
HideDetailRows SwitchParameter optionalposition: namedpipeline: False
Hide detail rows when applying outline metadata.
LabelSuffix String optionalposition: namedpipeline: False
Text appended to each group key in the subtotal label cell.
NoGrandTotal SwitchParameter optionalposition: namedpipeline: False
Skip writing a grand total row.
NoHeader SwitchParameter optionalposition: namedpipeline: False
Skip writing a summary header row.
NoOutline SwitchParameter optionalposition: namedpipeline: False
Skip applying outline metadata to detail rows.
OutlineLevel Int32 optionalposition: namedpipeline: False
Outline level used for grouped detail rows.
PassThru SwitchParameter optionalposition: namedpipeline: False
Emit OfficeIMO subtotal generation metadata.
Sheet String optionalposition: namedpipeline: False
Worksheet name when using Document.
SheetIndex Nullable`1 optionalposition: namedpipeline: False
Worksheet index (0-based) when using Document.
SummaryStartRow Nullable`1 optionalposition: namedpipeline: False
First row for the generated summary block.
ValueColumn String[] requiredposition: namedpipeline: Falsealiases: AggregateColumn, AggregateColumns, ValueColumns
Value columns as 1-based indexes, column letters, or header names.

Outputs

OfficeIMO.Excel.ExcelSubtotalResult