Looking for help with hlookup and concatenate or index match (newbie)

amyangel

New Member
Joined
Feb 15, 2019
Messages
3
I have a data sheet like the below and i want to for each row find the corresponding X and put it into the the below.
I'm not savy with VB and my work computer has Excel 2016.

Thanks for the help.

NamePD1PD2PS3MM5
A99XX
A05 XX
A30XXX
NameCode
Formula to say A99PD1, PD2
A05PD2, PS3
A30PD1, PD2, PD3

<colgroup><col style="width:48pt" width="64" span="6"> </colgroup><tbody>
</tbody>
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,788
try PowerQuery (Get&Transform)

NamePD1PD2PS3MM5NameCode
A99XXA99PD1, PD2
A05XXA05PD2, PS3
A30XXXA30PD1, PD2, PS3

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Name"}, "Attribute", "Value"),
    #"Grouped Rows" = Table.Group(#"Unpivoted Other Columns", {"Name"}, {{"Count", each _, type table}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Code", each Table.Column([Count],"Attribute")),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Code", each Text.Combine(List.Transform(_, Text.From), ", "), type text})
in
    #"Extracted Values"[/SIZE]
 

amyangel

New Member
Joined
Feb 15, 2019
Messages
3
try PowerQuery (Get&Transform)

[COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]Name[/COLOR][COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]PD1[/COLOR][COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]PD2[/COLOR][COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]PS3[/COLOR][COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]MM5[/COLOR][COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]Name[/COLOR][COLOR=[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=FFFFFF]#FFFFFF[/URL] ]Code[/COLOR]
A99XXA99PD1, PD2
A05XXA05PD2, PS3
A30XXXA30PD1, PD2, PS3

<tbody>
</tbody>


Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(Source, {"Name"}, "Attribute", "Value"),
    #"Grouped Rows" = Table.Group(#"Unpivoted Other Columns", {"Name"}, {{"Count", each _, type table}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Code", each Table.Column([Count],"Attribute")),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Code", each Text.Combine(List.Transform(_, Text.From), ", "), type text})
in
    #"Extracted Values"[/SIZE]
Hi thanks so much for the quick reply, do you know if there's another way? They administrator lock our computers at work so I am unable to install anything.
 

sandy666

Well-known Member
Joined
Oct 24, 2015
Messages
3,788
my work computer has Excel 2016.
you don't need install anything because Excel 2016 has PowerQuery (Get&Transform) built-in

edit:
and don't quote whole post, usually this is not necessary, please
use Reply instead of Reply With Quote
 
Last edited:

amyangel

New Member
Joined
Feb 15, 2019
Messages
3
Thank you it worked!! I appreciate the help so much and it has saved me a lot of time.
 

Forum statistics

Threads
1,081,976
Messages
5,362,511
Members
400,678
Latest member
alecalec202

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top