jmattingly85

New Member
Joined
Jul 12, 2010
Messages
33
Office Version
  1. 365
Platform
  1. Windows
I am needing some assistance with VLOOKUP, and that might not even be what I need to use. I have an Excel spreadsheet of data that currently looks as follows:

ABC
NameCodeAmount
NAME Acode 112
NAME Acode 213
NAME Acode 381
NAME Bcode 356
NAME Bcode 298
NAME Ccode 267
NAME Ccode 356
NAME Ccode 112

<tbody>
</tbody>


What I need to is get all of the data in Column B to be in columns D, E and F by their code description as follows:
ABCDEF
NameCodeAmountCode 1Code 2Code 3
NAME A121481
NAME B9856
NAME C126756

<tbody>
</tbody>

Is this possible to do fairly easy?
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
something like this?

NameCodeAmountNamecode 1code 2code 3
NAME Acode 1
12​
NAME A
12​
13​
81​
NAME Acode 2
13​
NAME B
98​
56​
NAME Acode 3
81​
NAME C
12​
67​
56​
NAME Bcode 3
56​
NAME Bcode 2
98​
NAME Ccode 2
67​
NAME Ccode 3
56​
NAME Ccode 1
12​
 
Upvote 0
ok, so you can use PowerQuery aka Get&Transform with M-code like this:

Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[COLOR="#FF0000"][ Code][/COLOR]), "Code", "Amount")
in
    #"Pivoted Column"[/SIZE]

there is space in [ Code] because tag name is the same. Remove this space if you will use it in the PQ

example excel file
 
Last edited:
Upvote 0
I guess I'm not even sure where to begin with that. I downloaded your example file and don't see where you put that code in.
 
Upvote 0
look at Data tab on the ribbon.

screenshot-15.png


if you see Get&Transform, use Show Queries then dbl click on the table there, it will open PQ editor, find Advanced Editor on the ribbon and you'll see the M-code from the post

if you don't see Get&Transform then .... you can ignore my posts :)
 
Last edited:
Upvote 0
Create a pivot table. PivotTables can help make your worksheets more manageable by summarizing data and allowing you to manipulate it in different ways.

1. Select the table or cells (including column headers) containing the data you want to use.
2. From the Insert tab, click the PivotTable command.
pivot_create_command.png

3. The Create PivotTable dialog box will appear.
3.1. Select option: Existing worksheet
3.2. Select cell E2
3.3. Press Ok
4. A blank PivotTable and Field List will appear.

3bc23c567ad68d89d53d2fb709e942af.jpg


5. Drag field between areas:

1663e865e65e72c7a7da0c2bb4ed2289.jpg


Ready, let me know if you have any doubts.
 
Upvote 0

Forum statistics

Threads
1,215,915
Messages
6,127,699
Members
449,398
Latest member
m_a_advisoryforall

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