Sum Values by Group in Excel (Show Totals Only Once per Group)
When working with grouped data in Excel, you may need to calculate the total for each group without displaying the same result repeatedly on every row.
For example, in a sales report where sales reps are grouped together, you might want to display the total sales amount only in the first row of each product group, leaving the remaining rows blank.

Although Excel provides functions like SUMIF and SUMIFS, displaying group totals only once usually requires combining multiple functions and managing cell references carefully.
With Kutools for Excel's Formula Helper Plus, you can quickly sum values by group and display each group's total only once—without manually writing complex formulas.
Why Summing Values by Group Can Be Challenging in Excel
Excel provides several methods for calculating grouped totals, including SUMIF, SUMIFS, PivotTables, and Subtotal.
However, when you want to display each group's total only once while keeping the original data layout, Excel's built-in methods can be less convenient.
Common challenges include:
- Combining multiple functions, such as IF and SUMIF.
- Identifying the first row of each group.
- Managing cell references correctly.
- Copying and maintaining formulas across multiple groups.
- Ensuring data is properly grouped to avoid incorrect or repeated results.
For users who frequently work with grouped data, manually creating and maintaining these formulas can be time-consuming and error-prone.
Why Use Formula Helper Plus?
Formula Helper Plus provides ready-to-use formulas that simplify common and advanced Excel calculations.
The Sum Values by Group formula calculates totals for matching groups and displays each total only in the first row of a consecutive group. The remaining rows within the group are left blank.
Instead of writing an IF and SUMIF formula manually, you simply select the required references through a guided interface.
Advantages
- No need to write complex IF and SUMIF formulas
- Calculate totals for matching groups
- Display group totals only once
- Keep the original worksheet structure
- Avoid repeating totals in every row
- Select cells and ranges directly
- Search formulas by keyword
- Browse formulas by category
- Customize formula names, expressions, and descriptions
Note: This formula is designed for data arranged in consecutive groups. All records belonging to the same group should be placed together before applying the formula.
How to Sum Values by Group Using Formula Helper Plus
The Sum Values by Group formula is available in the Online tab of Formula Helper Plus.
Example: Calculate Sales Totals by Sale Revs
Suppose your worksheet contains sale names in column H and sales amounts in column I.
You want to calculate the total sales for each sale rev and display the result only in the first row of each consecutive product group.
Step 1. Prepare Your Data
Before applying the formula, make sure all records belonging to the same group are arranged together.
If your data contains the same sale/product in separate sections, sort or otherwise organize the data by product first.
This is important because the formula uses the current and previous group identifiers to determine where each group begins.
Step 2. Open Formula Helper Plus
- Select the first output cell or output range, such as J2
- Click Kutools > Formula Helper > Formula Helper Plus.

Step 3. Find the Formula in the Dialog Box,
- Open the Online tab.
- Select the All category.
- Enter Sum Values by Group in the search box.
- Select the corresponding formula.

Step 4. Specify the Formula Parameters
The formula uses five references:
| PARAMETER | DESCRIPTION | EXAMPLE |
|---|---|---|
| CURRENTKEY | The group identifier in the current row. | H2 |
| PREVIOUSKEY | The group identifier in the previous row, used to determine whether the current row starts a new group. | H1 |
| KEYRANGE | The range containing the group identifiers to be matched. | H2:H10 |
| MATCHKEY | The group identifier whose values should be summed. | H2 |
| VALUERANGE | The range containing the numeric values to sum. | I12:I10 |
After specifying the parameters, click OK.

Step 5. View the First Result and Drag the Autofill to Show All Results
The formula calculates the total for the first group.

Drag the autofill handle down to show all totals of each group.

The remaining cells in each group are left blank.
Formula Explanation
The underlying formula follows this structure:
It combines two Excel functions:
- IF: Checks whether the current row belongs to the same group as the previous row.
- SUMIF: Calculates the total of all values matching the current group identifier.
How the Formula Works
The formula performs the following checks:
- Compare the current group identifier with the previous row.
- If both identifiers are the same, return a blank result.
- If they are different, calculate the total for the current group.
- Display the total in the first row of that group.
Important Notes
1. Group records must be consecutive
All records belonging to the same group should be placed together.
For example, this arrangement is suitable:
Blue
Blue
Black
Black
Red
Red
However, the following arrangement is not suitable for this formula's intended output:
Blue
Black
Black
Blue
Red
Red
Because Blue appears again after Black, the formula treats the later Blue row as the beginning of another group and may display the Blue total again.
2. The formula displays totals at the beginning of each group
It does not place the total at the end of the group or create a separate summary table.
3. The formula does not automatically rearrange your data
If the records are not already grouped, organize them before applying the formula.
4. SUMIF matches group identifiers across the specified KeyRange
The formula's group-boundary check and its summation work differently. The IF portion identifies where a new consecutive group starts, while SUMIF sums matching values across the specified range.
Therefore, if the same group appears in multiple separated sections, the formula can repeat the overall total at each new section rather than calculate separate section totals.
Common Scenarios
The Sum Values by Group formula is useful when your data is already organized into consecutive groups and you want to display each group's total only once.
1. Product Sales Reports
Calculate total sales for each product while displaying the total only in the first row of each product group.
2. Department Expense Reports
Sum expenses for each department when department records are grouped together.
3. Inventory Management
Calculate total quantities for each product category without repeating the total beside every inventory record.
4. Customer Order Reports
Display total order amounts for each customer when the customer's orders are listed consecutively.
5. Project Cost Tracking
Calculate total costs for each project while preserving the detailed expense records.
6. Employee Working Hours
Sum working hours for each employee when attendance records are organized by employee.
Why Formula Helper Plus Is Better Than Manual Excel Formulas
| Feature | Excel | Formula Helper Plus |
|---|---|---|
| Sum values by group | SUMIF formula | Ready-to-use formula |
| Display group totals only once | IF + SUMIF | Built-in formula template |
| Identify the first row of each group | Manual formula logic | Guided formula |
| Preserve original data layout | Yes | Yes |
| Select references through a dialog | Limited | Yes |
| Search formula templates | No dedicated library | Yes |
| Browse formulas by category | Limited | Yes |
| Edit formula name | No dedicated library | Yes |
| Edit formula expression | Manual | Yes |
| Edit formula description | No dedicated library | Yes |
Conclusion
When working with consecutive groups in Excel, displaying a total only once per group can make reports cleaner and easier to understand.
Although Excel's IF and SUMIF functions can achieve this result, constructing the formula manually requires understanding group comparisons and cell references.
With Kutools for Excel's Formula Helper Plus, you can quickly locate the Sum Values by Group formula, specify the required references, and calculate totals for consecutive groups without writing the formula yourself.
Whether you're preparing sales reports, inventory records, expense summaries, or project data, Formula Helper Plus makes grouped calculations simpler and more convenient.
Just remember to arrange matching group records consecutively before applying the formula to ensure the totals appear in the intended locations.
Best Office Productivity Tools
Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time. Click Here to Get The Feature You Need The Most...
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.
- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in
Table of contents
- Why Summing Values by Group Can Be Challenging in Excel?
- Why Use Formula Helper Plus?
- How to Sum Values by Group Using Formula Helper Plus?
- Common Scenarios
- Why Formula Helper Plus Is Better Than Excel
- Conclusion
Kutools for Excel
Boosts Excel With 300+
Powerful Features
Boost your Excel productivity with Kutools for Excel—300+ powerful tools, free to try for 30 days.