Trying to sum values of all keys (that are unique) and place it in the below that column
Something like this
CodePudding user response:
Exel has built-in functionality for this, called "Outline". It is in the data ribbon.
Select a cell in the data, then click Data ribbon > Outline > Subtotal. You can then specify which columns you want to calculated totals for. In this example, you want to total columns titled "b" and "c" at each change in column titled "a".
After confirming the dialog, the result looks like this. You can see that Excel uses the Subtotal function to calculate the subtotals.
If you need to add more data, you can insert rows in the appropriate places, or, remove the Outline, add more data to the bottom of the list, sort by "a" and re-do the Outline.
Note: It is often better to keep data and reporting on data (the totals calculations) separate. Consider using a pivot table to create an overview of totals b and c per category a. Once set up, you can add more data in any order to your source table and just refresh the pivot table. Or use Sumifs() formulas to build a calculation table outside of your data entry table.