Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
You can automatically create subtotals for any repeating values in a spreadsheet. Aspose.Cells provides API features that help you add subtotals to spreadsheets programmatically.
C#
// Instantiating a Workbook object
Workbook workbook = new Workbook("../../data/test.xlsx");
// Get the Cells collection in the first worksheet
Cells cells = workbook.Worksheets[0].Cells;
// Create a cell area, i.e., B3:C19
CellArea ca = new CellArea();
ca.StartRow = 2;
ca.StartColumn = 1;
ca.EndRow = 18;
ca.EndColumn = 2;
// Apply subtotal; the consolidation function is Sum and it will be applied to
// the second column (C) in the list
cells.Subtotal(ca, 0, ConsolidationFunction.Sum, new int[] { 1 });
// Save the Excel file
workbook.Save("AsposeTotal.xls");
Download Calculate Sub Totals from any of the below-mentioned social coding sites:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.