vlookup question using more than on variable

bionicle

Board Regular
Joined
Apr 23, 2009
Messages
186
Office Version
  1. 365
Platform
  1. Windows
hi all need some help please.

in column 'A' I have a list of numbers with multiple duplicates. in column 'b' I have a list of names, in column 'c' I have a list of colours.
ABC
1daveyellow
1davered
2paulyellow
2paulgreen
3markred
3markred
<colgroup><col width="72" style="width: 54pt;" span="3"> <tbody> </tbody>



what I would like to do in column 'D & E' is to have these values next to each other so 'a1' would stay the same (1) and 'd1' would say yellow & 'E1' would say red.

ABCDE
1daveyellowYELLOWRED
2paulyellowYELLOWGREEN
3markredREDRED
<colgroup><col width="72" style="width: 54pt;" span="5"> <tbody> </tbody>


any help would be appreciated.

Steve
 
Last edited:

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi Steve,

Are the duplicates always in a row? Is there always one duplicate? If yes on both of these, you could do something like this:

Excel 2007 32 bit
ABCDE
11daveyellow=C1=C2
21davered
32paulyellow=C3=C4
42paulgreen
53markred=C5=C6
63markred

<tbody>
</tbody>
Sheet1
 
Upvote 0
try PowerQuery

ABCABColor.1Color.2
1​
daveyellow
1​
daveyellowred
1​
davered
2​
paulyellowgreen
2​
paulyellow
3​
markredred
2​
paulgreen
3​
markred
3​
markred

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"A", "B"}, {{"Count", each _, type table}}),
    #"Added Custom" = Table.AddColumn(#"Grouped Rows", "Color", each Table.Column([Count],"C")),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Color", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "Color", Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv), {"Color.1", "Color.2"})
in
    #"Split Column by Delimiter"[/SIZE]
 
Upvote 0
I've never used PowerQuery so how would I incorporate this into excel?

I've downloaded PowerQuery and now have it installed.
 
Upvote 0
thank you for the step guide, did what you said and received an error message.

Expression.error The column 'A' of the table wasn't found. details A

any ideas
 
Upvote 0
You are welcome

PowerQuery works with Tables, columns and content. Each column has header, in this case A, B and C
if you've any diifference you need to adapt it into M code
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,931
Members
449,480
Latest member
yesitisasport

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