Sum, Count, Average Value, etc by color in Spreadsheet/Excel
The API can perform data calculations, summation, and averaging, and can also find the maximum and minimum values in an Excel spreadsheet based on the fill or font color of the cells.
Calculate Operation | Description |
---|---|
Count | Determine the number of cells with the same color. |
Sum | Calculate the total value of cells with the same color. |
Max Value | Identify the highest value among cells with the same color. |
Min Value | Find the lowest value among cells with the same color. |
Average Value | Compute the mean value of cells with the same color. |
Aggregating Cells by Color API
PUT http://api.aspose.cloud/v4.0/cells/calculate/aggregate/color
Request Parameters:
Parameter Name | Type | Path/Query String/HTTPBody | Description |
---|---|---|---|
Spreadsheet | File | FormData | Upload spreadsheet file. |
Worksheet | String | Query | Specifies the worksheet. |
Range | String | Query | Specifies the range. |
Operation | String | Query | Specify calculation operation methods, including Sum, Count, Average, Min, and Max. |
ColorPosition | String | Query | Indicates the content to sum and count based on background color and/or font color. |
Region | String | Query | The spreadsheet region setting. |
Password | String | Query | The password for opening the spreadsheet file. |
Response
{
"Name": "AggregateResultByColorResponse",
"Type": "Class",
"ParentName": "CellsCloudResponse",
"IsAbstract": false,
"Properties": [
{
"Name": "AggregateResults",
"DataType": {
"Identifier": "Array",
"Reference": "AggregateResultByColor",
"ElementDataType": {
"Reference": "AggregateResultByColor"
}
}
},
{
"Name": "Code",
"DataType": {
"Identifier": "Integer",
}
},
{
"Name": "Status",
"DataType": {
"Identifier": "String",
}
}
]
}
Error Codes
- 400 Bad Request: Invalid Apose.Cells Cloud API URI.
- 401 Unauthorized: Invalid access token. Or invalid client id and secret.
- 404 Not Found: The spreadsheet file not accessible.
- 500 Server Error: The spreadsheet has encountered an anomaly in obtaining calculation data.
Where should we use the Aggregate by Color API?
In a spreadsheet, data from different categories is displayed in different colors, allowing operations such as summing, counting, calculating averages, and finding maximum and minimum values based on color.
Why should you use the Aggregate by Color API?
- Provide methods for color data analysis.
- Classify and calculate data based on color to provide foundational data for data analysis.
- Development can be quickly completed through the existing SDK.
How to Use the Aggregate by Color API with SDKs
Aggregate by Color API Specification
The Aggregate by Color API Specification defines a publicly accessible programming interface and allows you to carry out REST interactions directly from a web browser.
Use Aspose.Cells Cloud SDKs
Using the SDK is the fastest way to develop, as it abstracts away the low-level details, allowing you to aggregate calculations by cell color with just a short piece of code. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to make calls to Aspose.Cells web services using various SDKs: