Link 2 tables

TomasM

New Member
Joined
Dec 10, 2019
Messages
10
Office Version
  1. 2013
Platform
  1. Windows
Good morning everyone,

I'm making my internship in a company, and have a lot of work with excel. I'm ''beginner'' so struggling some times.
What I need to do is :

A
B
C
1
Company
Group
Quantity
2
ABC230
3
DEF120
4
GHI225

This is the main table, where you enter all the values (company name, group of consumption, and quantity of consumption).

E
F
1
(Group) 1
(Group) 2
2
2030
3
25

This is the second table. If I enter infos in the first table, I need that it appears automatically in the second one.

Sorry for my English, hopefully I was clear. Thank you for your help !
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
My question is:
Are we really dealing with a Excel Table?
A Excel Table is a Range on a Excel Sheet.

We may have several tables on the same sheet.

If we are dealing with a Excel Table we need the name of the two Tables.

Are you looking for a Vba solution or a formula solution?
 
Upvote 0
How about
Book1
ABCDEF
1CompanyGroupQuantity(Group) 1(Group) 2
2ABC2302030
3DEF120 25
4GHI225  
HPV
Cell Formulas
RangeFormula
E2:E4E2=IFERROR(AGGREGATE(14,6,$C$2:$C$100/($B$2:$B$100=1),ROWS($E$2:$E2)),"")
F2:F4F2=IFERROR(AGGREGATE(14,6,$C$2:$C$100/($B$2:$B$100=2),ROWS($F$2:$F2)),"")
 
Upvote 0
Cross posted link 2 tables

While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules). This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0
you can try with Power Query
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Sort = Table.Sort(Source,{{"Group", Order.Ascending}}),
    Pivot = Table.Pivot(Table.TransformColumnTypes(Sort, {{"Group", type text}}, "en-GB"), List.Distinct(Table.TransformColumnTypes(Sort, {{"Group", type text}}, "en-GB")[Group]), "Group", "Quantity"),
    RC = Table.RemoveColumns(Pivot,{"Company"})
in
    RC
CompanyGroupQuantitygaaaap12
ABC23030
DEF12020
GHI22525


or with Prefix
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Sort = Table.Sort(Source,{{"Group", Order.Ascending}}),
    Prefix = Table.TransformColumns(Sort, {{"Group", each "(Group) " & Text.From(_, "en-GB"), type text}}),
    Pivot = Table.Pivot(Table.TransformColumnTypes(Prefix, {{"Group", type text}}, "en-GB"), List.Distinct(Table.TransformColumnTypes(Prefix, {{"Group", type text}}, "en-GB")[Group]), "Group", "Quantity"),
    RC = Table.RemoveColumns(Pivot,{"Company"})
in
    RC
(Group) 1(Group) 2
30
20
25
 
Upvote 0
or even like this
Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Sort = Table.Sort(Source,{{"Group", Order.Ascending}}),
    Prefix = Table.TransformColumns(Sort, {{"Group", each "(Group) " & Text.From(_, "en-GB"), type text}}),
    Pivot = Table.Pivot(Table.TransformColumnTypes(Prefix, {{"Group", type text}}, "en-GB"), List.Distinct(Table.TransformColumnTypes(Prefix, {{"Group", type text}}, "en-GB")[Group]), "Group", "Quantity")
in
    Pivot
CompanyGroupQuantitygaaaapCompany(Group) 1(Group) 2
ABC230ABC30
DEF120DEF20
GHI225GHI25
 
Upvote 0

Forum statistics

Threads
1,215,772
Messages
6,126,804
Members
449,337
Latest member
BBV123

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