Aggregate text data into table

Sirod

New Member
Joined
Aug 6, 2009
Messages
47
Hello,

I want to create an aggregate data table (similar to a pivot table result) that shows text values, not numeric. I have a number of rows of data that show an individual ID number, name, district, and grade - see sample table below:

ID #NameDistrictGrade
12301John SmithNorthA
12304Jane DoeWestC
13568Robert SmithWestB
23568Bob DoeEastB
87567Jane SmithSouthD
<colgroup><col width="64" style="width: 48pt;"> <col width="83" style="width: 62pt; mso-width-source: userset; mso-width-alt: 3035;"> <col width="64" style="width: 48pt;" span="2"> <tbody> </tbody>

I need to display this data so that the ID and name of each person is listed at the intersection their District and Grade. For example:

NorthEastSouthWest
A12301 John Smith
B 23568 Bob Doe 13568 Robert Smith
C 12304 Jane Doe
D 87567 Jane Smith
<colgroup><col width="64" style="width: 48pt;"> <col width="120" style="width: 90pt; mso-width-source: userset; mso-width-alt: 4388;" span="4"> <tbody> </tbody>
No VBA solutions please, as I am not familiar with it.

Thanks.
<colgroup><col width="64" style="width: 48pt;"> <col width="83" style="width: 62pt; mso-width-source: userset; mso-width-alt: 3035;"> <col width="64" style="width: 48pt;" span="2"> <tbody> </tbody>
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
That's a tough task with formulas. PowerQuery makes quick work of it, though. I hope this helps you, and I'll post it here for everyone's benefit.

Here is the M code for our Table1
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID #", Int64.Type}, {"Name", type text}, {"District", type text}, {"Grade", type text}}),
    #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Changed Type", {{"ID #", type text}}, "en-CA"),{"ID #", "Name"},Combiner.CombineTextByDelimiter(" ", QuoteStyle.None),"Merged"),
    #"Pivoted Column" = Table.Pivot(#"Merged Columns", List.Distinct(#"Merged Columns"[District]), "District", "Merged")
in
    #"Pivoted Column"
 
Last edited:
Upvote 0
Without formulas or code, this can be done with a query (table). Definition,
Code:
TRANSFORM MAX([ID #] & ' ' & Name)
SELECT Grade
FROM [YourWorksheetName$]
GROUP BY Grade
PIVOT District
should be ok in all excel versions since Excel 95
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,975
Members
449,095
Latest member
Mr Hughes

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