## How to sum values by group in Excel?

Here are two columns, one is the product name, and the other is Sales. Now I want to sum the sales by the same product as below screenshot shown. How can I solve it in Excel?

Sum values by group with using formula

Calculate or combine values by group with using Kutools for Excel

#### Sum values by group with using formula

You can sum values by group with one formula easily in Excel.

Select next cell to the data range, type this =IF(A2=A1,"",SUMIF(A:A,A2,B:B)), (A2 is the relative cell you want to sum based on, A1 is the column header, A:A is the column you want to sum based on, the B:B is the column you want to sum the values.) Press Enter key, drag fill handle down to the cells to fill the formula.

#### Calculate or combine values by group with using Kutools for Excel

If you want to do other calculations by groups, such count, find max or min value, or combine values based on group, you can try Kutools for Excel’s Advanced Combine Rows utility.

 with more than 300 handy functions, makes your jobs more easier. Free Downloadfree full-featured in 30 days

After Kutools for Excel, please do as below:

1. Select the data range then click Kutools > Merge & Split > Advanced Combine Rows.

1) Specify a column as the key column which is used to calculate or combine values based on;

2) Choose an option in one operation as you need.

3. Click Ok, then the values will be calculated or combined as below screenshot shown:

 Sum by group Combine by group

### Best Office Productivity Tools

 🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions… Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ... Super Lookup: Multiple Criteria VLookup  |   Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup .... Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List .... Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ... Featured Features: Grid Focus   |  Design View   |   Big Formula Bar   |  Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells   |  Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ... Top 15 Toolsets:  12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

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!
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
hi what if the date is also added to it and then how we can calculate total for particular item, date wise. see below
Date item qty
3-Mar-21 blue 24
3-Mar-21 green 15
3-Mar-21 green 46
3-Mar-21 Blue 54
3-Mar-21 Red 6
4-Mar-21 Red 18
4-Mar-21 Blue 21
4-Mar-21 green 39
4-Mar-21 green 52
4-Mar-21 red 35
4-Mar-21 blue 19
5-Mar-21 green 54
5-Mar-21 green 26
5-Mar-21 Blue 29
5-Mar-21 Red 31
5-Mar-21 Red 74
5-Mar-21 Blue 20
5-Mar-21 green 85
5-Mar-21 green 56
This comment was minimized by the moderator on the site
Not exactly working for me. The A1 in the A2=A1 is does not stay constant once pasted and is off always by one row. If I lock the cell, in my case =IF(A2=\$A\$1,"",SUMIF(A:A,A2,H:H)), The formula works but populates in every column cell.
This comment was minimized by the moderator on the site
How use =IF(A2=A1,"",SUMIF(A:A,A2,B:B))
If in coloumn A data Blue is come after black
This comment was minimized by the moderator on the site