Group by Sum in Excel

0 votes

Let's assume that I have the following table in Excel

A     B
Item  quantity_sold
A     3
A     4
A     1
B     5
B     2
D     12
C     3
C     7
C     8

and I need to sum up quantity_sold grouped by Item and print the results on the adjacent column only once per group, similar to the following

A     B                 C   
Item  quantity_sold    SUM_by_item_type
A     3                 8
A     4
A     1
B     5                 7
B     2
D     12                12
C     3                 18
C     7
C     8

Is there any way I can achieve this without using Pivot Tables?

enter image description here

Feb 21, 2022 in Database by Edureka
• 13,690 points
583 views

1 answer to this question.

0 votes

It is very easy and you can do it with a simple formula 

if u select the next column for rearranging the data and type the formula =IF(A2=A1,"",SUMIF(A:A,A2,B:B))

Here A2 is a relative cell you want to sum  based on, A1,A is the column you want to sum based on the B column you want to sum the values

answered Feb 21, 2022 by gaurav
• 23,260 points

Related Questions In Database

0 votes
1 answer

What is GROUP BY statement in MySQL?

This statement is used with the aggregate ...READ MORE

answered Nov 23, 2018 in Database by Sahiti
• 6,370 points
654 views
0 votes
0 answers

Execution sequence of Group By, Having and Where clause in SQL Server?

I'm just not sure how a SQL ...READ MORE

Aug 19, 2022 in Database by Kithuzzz
• 38,000 points
597 views
0 votes
1 answer

What is the ORDER BY statement in MySQL?

This statement is used to sort the ...READ MORE

answered Nov 23, 2018 in Database by Sahiti
• 6,370 points
676 views
0 votes
1 answer

How to display the queries executed by a particular user in MySQL?

From the version 5.1.7 onward, MySQL allows ...READ MORE

answered Mar 7, 2019 in Database by Mishti
• 480 points
4,365 views
0 votes
1 answer

Getting SUM for hh:mm:ss in EXCEL

The times are probably preserved as text. SUM ...READ MORE

answered Oct 23, 2022 in Others by narikkadan
• 63,600 points
6,592 views
0 votes
1 answer

How to automatically nest rows of an Excel spreadsheet using level values?

More grouping levels have been added to ...READ MORE

answered Nov 21, 2022 in Others by narikkadan
• 63,600 points
680 views
0 votes
1 answer
0 votes
1 answer

Excel sum formula without table - Equivalent to the Math Sum Symbol

You can use SUMPRODUCT for this. Assuming X is in cell B1, ...READ MORE

answered Dec 11, 2022 in Others by narikkadan
• 63,600 points
452 views
0 votes
1 answer

Conditional Sum in Excel that counts values above X as X

B1 formula is: =SUMIF(A1:A5,"<=5") +COUNTIF(A1:A5,">5") *5 Fill in the blanks ...READ MORE

answered Mar 31, 2022 in Database by gaurav
• 23,260 points
407 views
0 votes
1 answer

Merging Two excel files as two sheets in one workbook in java

Basically for this, you need to create ...READ MORE

answered Feb 21, 2022 in Database by gaurav
• 23,260 points
1,076 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP