Pivot table - multiple entries per row

Tashat

Board Regular
Joined
Jan 12, 2005
Messages
135
Office Version
  1. 365
Platform
  1. Windows
Hello wonderful Excel people

Can someone help me with a pivot table issue please? (data below is a short excerpt of test data) - I have many more lines. Most people in the list speak more than one language ( separated by | ). I want to be able to pull a pivot table which shows all the speakers of each language. So for example, I want each language in the column down the side and then all the names of the people who speak that language. Therefore, some people's name will appear 2 or 3 times in the pivot table. Is this possible? Can anyone advise how I could do this?

I may also want to pull in region details at some point, but one set at a time. Thanks in advance

Book1
ABC
1NameRegionLanguage
2HarkishanYorkshire & The HumberSwahili
3BushraYorkshire & The HumberPunjabi | Urdu
4NusratYorkshire & The HumberGujarati | Other
5NedaCheshire & LiverpoolPunjabi | Urdu
6GloriaCheshire & LiverpoolBengali
7AshleighWest MidlandsNot Applicable
8OyekanmiWest MidlandsArabic
9SubhashWest MidlandsCantonese | Mandarin | Other
10ZeidWest MidlandsYoruba | Other
11AnwaarWest MidlandsNot Applicable
12CatherineWest MidlandsArabic
13SumiaWest MidlandsPunjabi | Urdu
14HaseebWest MidlandsPunjabi | Urdu
15SanjayWest MidlandsGujarati | Punjabi | Urdu | Other
16AthmanWest MidlandsGujarati | Swahili | Urdu
17NiazWest MidlandsBengali
18JyotiWest MidlandsPunjabi | Urdu | Other
19IftikharEast MidlandsGujarati | Urdu | Other
20GuixianEast MidlandsMandarin
21LolitaEast MidlandsArabic | Other
Sheet2
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C14:C21Expression=$I14="Vacancy"textNO
C14:C21Expression=$I14="Resigned"textNO
C2:C13Expression=$I2="Vacancy"textNO
C2:C13Expression=$I2="Resigned"textNO
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi - is anyone able to help me with this issue please? I really need a pivot table which can show all the languages once and then list the names of each person who can speak a given language. It is difficult because there is only one entry for each person and within one cell, there could be 3 or 4 language they speak, separated by a | ... I'm stumped by this one.
 
Upvote 0
you mean like this?
NameRegionLanguage
LolitaEast MidlandsArabic
OyekanmiWest MidlandsArabic
CatherineWest MidlandsArabic
GloriaCheshire & LiverpoolBengali
NiazWest MidlandsBengali
SubhashWest MidlandsCantonese
IftikharEast MidlandsGujarati
SanjayWest MidlandsGujarati
NusratYorkshire & The HumberGujarati
AthmanWest MidlandsGujarati
SubhashWest MidlandsMandarin
GuixianEast MidlandsMandarin
AnwaarWest MidlandsNot Applicable
AshleighWest MidlandsNot Applicable
SanjayWest MidlandsOther
LolitaEast MidlandsOther
JyotiWest MidlandsOther
NusratYorkshire & The HumberOther
IftikharEast MidlandsOther
SubhashWest MidlandsOther
ZeidWest MidlandsOther
NedaCheshire & LiverpoolPunjabi
BushraYorkshire & The HumberPunjabi
JyotiWest MidlandsPunjabi
HaseebWest MidlandsPunjabi
SumiaWest MidlandsPunjabi
SanjayWest MidlandsPunjabi
AthmanWest MidlandsSwahili
HarkishanYorkshire & The HumberSwahili
NedaCheshire & LiverpoolUrdu
IftikharEast MidlandsUrdu
SumiaWest MidlandsUrdu
BushraYorkshire & The HumberUrdu
JyotiWest MidlandsUrdu
SanjayWest MidlandsUrdu
HaseebWest MidlandsUrdu
AthmanWest MidlandsUrdu
ZeidWest MidlandsYoruba

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Split = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Language", Splitter.SplitTextByDelimiter(" | ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Language"),
    Sort = Table.Sort(Split,{{"Language", Order.Ascending}})
in
    Sort
 
Last edited:
Upvote 0
or like this
LanguageNames
ArabicCatherine, Lolita, Oyekanmi
BengaliGloria, Niaz
CantoneseSubhash
GujaratiAthman, Iftikhar, Nusrat, Sanjay
MandarinGuixian, Subhash
Not ApplicableAnwaar, Ashleigh
OtherIftikhar, Jyoti, Lolita, Nusrat, Sanjay, Subhash, Zeid
PunjabiBushra, Haseeb, Jyoti, Neda, Sanjay, Sumia
SwahiliAthman, Harkishan
UrduAthman, Bushra, Haseeb, Iftikhar, Jyoti, Neda, Sanjay, Sumia
YorubaZeid
 
Upvote 0
or like this
LanguageNames
ArabicCatherine, Lolita, Oyekanmi
BengaliGloria, Niaz
CantoneseSubhash
GujaratiAthman, Iftikhar, Nusrat, Sanjay
MandarinGuixian, Subhash
Not ApplicableAnwaar, Ashleigh
OtherIftikhar, Jyoti, Lolita, Nusrat, Sanjay, Subhash, Zeid
PunjabiBushra, Haseeb, Jyoti, Neda, Sanjay, Sumia
SwahiliAthman, Harkishan
UrduAthman, Bushra, Haseeb, Iftikhar, Jyoti, Neda, Sanjay, Sumia
YorubaZeid
Yes this one. Thank you.
 
Upvote 0
sure, so use this
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Split = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Language", Splitter.SplitTextByDelimiter(" | ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Language"),
    Sort = Table.Sort(Split,{{"Name", Order.Ascending}}),
    Group = Table.Group(Sort, {"Language"}, {{"Count", each _, type table}}),
    List = Table.AddColumn(Group, "Names", each [Count][Name]),
    Extract = Table.TransformColumns(List, {"Names", each Text.Combine(List.Transform(_, Text.From), ", "), type text}),
    Srt = Table.Sort(Extract,{{"Language", Order.Ascending}})
in
    Srt
 
Upvote 0
Solution
sure, so use this
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Split = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Language", Splitter.SplitTextByDelimiter(" | ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Language"),
    Sort = Table.Sort(Split,{{"Name", Order.Ascending}}),
    Group = Table.Group(Sort, {"Language"}, {{"Count", each _, type table}}),
    List = Table.AddColumn(Group, "Names", each [Count][Name]),
    Extract = Table.TransformColumns(List, {"Names", each Text.Combine(List.Transform(_, Text.From), ", "), type text}),
    Srt = Table.Sort(Extract,{{"Language", Order.Ascending}})
in
    Srt
Thank you so much for this. Are you able to explain to me where I need to paste this query/language please? I'm searching for Power Query - not having much luck
 
Upvote 0
XL365 contain Power Query, this is built-in there
so
create blank query
blankquery2019.png

hope that way is similar to XL365
then go to Advanced Editor and replace all there with code from the post
remember that the name of the source table should be the same as in the code (here: Table1), if not change to proper name in the code.
then Ok, Close&Load
 
Upvote 0
sure, so use this
Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Split = Table.ExpandListColumn(Table.TransformColumns(Source, {{"Language", Splitter.SplitTextByDelimiter(" | ", QuoteStyle.Csv), let itemType = (type nullable text) meta [Serialized.Text = true] in type {itemType}}}), "Language"),
    Sort = Table.Sort(Split,{{"Name", Order.Ascending}}),
    Group = Table.Group(Sort, {"Language"}, {{"Count", each _, type table}}),
    List = Table.AddColumn(Group, "Names", each [Count][Name]),
    Extract = Table.TransformColumns(List, {"Names", each Text.Combine(List.Transform(_, Text.From), ", "), type text}),
    Srt = Table.Sort(Extract,{{"Language", Order.Ascending}})
in
    Srt
Thank you so much for this. Are you able to explain to me where I need to paste this query/language please? I'm searching for Power Query - not having much luck
XL365 contain Power Query, this is built-in there
so
create blank query
View attachment 27023
hope that way is similar to XL365
then go to Advanced Editor and replace all there with code from the post
remember that the name of the source table should be the same as in the code (here: Table1), if not change to proper name in the code.
then Ok, Close&Load
Wow - thank you. I'm getting much closer now, but I'm now getting an error which says:

"[Expression.Error] The column 'Language' of the table wasn't found."

I have named the table - "table1" by naming the range of the source data. Is that correct? Should I include the row headers in the named range? Thank you so much for your support with this. It's great I'm learning a whole new area of Excel.
 
Upvote 0
the best way is select whole range and hit Ctrl+T, it will create excel table
about error: check if the name of column Language is real Language but not language. Power Query is case sensitive !!!
 
Upvote 0

Forum statistics

Threads
1,216,100
Messages
6,128,824
Members
449,470
Latest member
Subhash Chand

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