List down values based on main Tag and a sub tag and get totals

nisanthp

New Member
Joined
Jul 1, 2009
Messages
29
Hi .

I've a data set in which there are data and Sub data and Sub data has a quanity against each line. The data is not in particular order and data will get added to the bottom of the list. I want to make a dash board like this :


Data Sub dataTotal of sub data
AA115
A21
A333
A455
BB141
B233
B392
CC190
C250


The Data/Sub data need not be dynamic, can close for a particulat set of day. Pivot table can do this but the issues is there are lot of other data columns in between the Sub data & qty which is not required for this dash board.

Appreciate any help on this.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
What does the source data look like that generated the table you are showing in the original post. We are not mind readers here and need examples to provide workable solutions. Please XL2BB functionality.
 
Upvote 0
Sorry my bad, orginal data set will be like this :


CC1148
CC726
AA1470
CC99
AA1265
AA251
GST-23 15
AA1191
FF2 84
CC4 27
GG7 37
DD2245
GG5 60
CC2223
AA14202
FF1 114
AA13108
AA8105
AA11108
AA8116
GG5 165
CC368
AA7843
GG9 27
CC6 35
CC5 96
AA88
AA13324
GG3 8
AA12142
GST-17B 3
AA7137
FF1 19
AA11197
AA2156
 
Upvote 0
One method is with Power Query shown in F:H columns

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"Column1", "Column2"}, {{"Sum", each List.Sum([Column3]), type number}}),
    #"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Column1", Order.Ascending}, {"Column2", Order.Ascending}})
in
    #"Sorted Rows"

Another method is with GroupBy Function

Excel Formula:
=GROUPBY(Table1[[#All],[Column1]:[Column2]],Table1[[#All],[Column3]],SUM,3,0)

Book3
ABCDEFGHIJKL
1Column1Column2Column3Column4Column1Column2SumColumn1Column2Column3
2CC1148AA1661AA1661
3CC726AA11305AA11305
4AA1470AA12207AA12207
5CC99AA13432AA13432
6AA1265AA14202AA14202
7AA251AA2207AA2207
8GST-2315AA7980AA7980
9AA1191AA8229AA8229
10FF284CC1148CC1148
11CC427CC2223CC2223
12GG737CC368CC368
13DD2245CC427CC427
14GG560CC596CC596
15CC2223CC635CC635
16AA14202CC726CC726
17FF1114CC99CC99
18AA13108DD2245DD2245
19AA8105FF1133FF1133
20AA11108FF284FF284
21AA8116GG38GG38
22GG5165GG5225GG5225
23CC368GG737GG737
24AA7843GG927GG927
25GG927GST-17B3GST-17B3
26CC635GST-2315GST-2315
27CC596
28AA88
29AA13324
30GG38
31AA12142
32GST-17B3
33AA7137
34FF119
35AA11197
36AA2156
Sheet1
Cell Formulas
RangeFormula
J1:L26J1=GROUPBY(Table1[[#All],[Column1]:[Column2]],Table1[[#All],[Column3]],SUM,3,0)
Dynamic array formulas.
 
Upvote 0
Thanks for the reply. I dont have Groupby option in my excel version and new to Power Query as well. Will try to learn PQ and see
 
Upvote 0
What version of Excel are you using? Please update your profile to show the particular version so that we can cater our response to the specific Excel version you are using. Here is some PQ information that should help you.

Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").

It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.

- Follow this link to learn how to install Power Query in Excel 2010 / 2013.

- Follow this link for an introduction to Power Query functionality.

- Follow this link for a video which demonstrates how to use Power Query code provided.
 
Upvote 0

Forum statistics

Threads
1,225,741
Messages
6,186,763
Members
453,370
Latest member
juliewar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top