transforming and organizing results in tournament

dworkin

New Member
Joined
Dec 2, 2020
Messages
7
Office Version
  1. 2019
Platform
  1. Windows
Hi,
I'm organizing a tournament and i need to convert data from one sheet to another.
original sheet:
roundtablep1 IDp1 namep1 scorep2 IDp2 namep2 scorep3 IDp3 namep3 scorep4 IDp4 namep4 score
1​
1​
1​
Trinkl Matthias
15000,0​
2​
Diviš Martin
5000,0​
3​
Diviš Carrie
-5000,0​
4​
Beck Daniel
-15000,0​
1​
2​
5​
Hoskovec David
12000,0​
6​
Bílek Lukáš
6000,0​
7​
Konderlová Jana
-12000,0​
8​
Berkman Tadeáš
-6000,0​
1​
3​
9​
Trmal Vojtěch
9000,0​
10​
Duraković Zijad
4000,0​
11​
Kruse Markus
-5000,0​
12​
Frings Jonas
-8000,0​
1​
4​
13​
Rappe Marco
8000,0​
14​
Schlich Manuel
2000,0​
15​
Völker Marcus
-8300,0​
16​
Hahn Timur
-1700,0​
1​
5​
17​
Kammer Stefanie
7000,0​
18​
Laube Waldemar
1500,0​
19​
Rus Joaquin Derrac
-7200,0​
20​
Huynh Joe-Calberson
-1300,0​
1​
6​
21​
Trepinska Karolina
6000,0​
22​
Debrun Luc
7500,0​
23​
Potmeer Pieter
-20100,0​
24​
Arendarski Bartosz
6600,0​
1​
7​
25​
Zieliński Tomasz
5000,0​
26​
Chabelska Katarzyna
-5800,0​
27​
Wojtasik Pawel
12500,0​
28​
Khezam Rene
-11700,0​
tournament goes for 8 rounds - so number in column round changes.
I need a function, that would pick the scores and put them in this table in another sheet in the corresponding round for each player (as shown)
SurnameNameNumberCountryEMATotalRound 1Round 2Round 3Round 4Round 5Round 6Round 7Round 8
TrinklMatthias
1​
AUT01000108
0​
1500
DivišMartin
2​
CZE22000003
0​
5000
DivišCarrie
3​
CZE22000013
0​
-5000
BeckDaniel
4​
CZE22000022
0​
-15000
table is bigger with all the names of course.
Is there an easy sollution for this? I tried combination of IF and VLOOKUP, but it doesn't work.
Thanks for any ideas
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Hopefully this will get you part of the way there. It's kind of confusing since your expected results have 'Country' and 'EMA' but those columns aren't in your original dataset. This solution uses Power Query.

Book2
ABCDEFGHIJKLMN
1roundtablep1 IDp1 namep1 scorep2 IDp2 namep2 scorep3 IDp3 namep3 scorep4 IDp4 namep4 score
2111Trinkl Matthias-18,0002Diviš Martin-18,0003Diviš Carrie-18,0004Beck Daniel-18,000
3125Hoskovec David15,0006Bílek Lukáš-18,0007Konderlová Jana15,0008Berkman Tadeáš-18,000
4139Trmal Vojtěch13,00010Duraković Zijad-18,00011Kruse Markus13,00012Frings Jonas-18,000
51413Rappe Marco12,00014Schlich Manuel-18,00015Völker Marcus12,00016Hahn Timur-18,000
61517Kammer Stefanie-2,00018Laube Waldemar-18,00019Rus Joaquin Derrac-2,00020Huynh Joe-Calberson-18,000
71621Trepinska Karolina-16,00022Debrun Luc-18,00023Potmeer Pieter-16,00024Arendarski Bartosz-18,000
81725Zieliński Tomasz3,00026Chabelska Katarzyna-18,00027Wojtasik Pawel3,00028Khezam Rene-18,000
9211Trinkl Matthias8,0002Diviš Martin-18,0003Diviš Carrie8,0004Beck Daniel-18,000
10225Hoskovec David-9,0006Bílek Lukáš-18,0007Konderlová Jana-9,0008Berkman Tadeáš-18,000
11239Trmal Vojtěch-1,00010Duraković Zijad-18,00011Kruse Markus-1,00012Frings Jonas-18,000
122413Rappe Marco-11,00014Schlich Manuel-18,00015Völker Marcus-11,00016Hahn Timur-18,000
132517Kammer Stefanie15,00018Laube Waldemar-18,00019Rus Joaquin Derrac15,00020Huynh Joe-Calberson-18,000
142621Trepinska Karolina-4,00022Debrun Luc-18,00023Potmeer Pieter-4,00024Arendarski Bartosz-18,000
152725Zieliński Tomasz18,00026Chabelska Katarzyna-18,00027Wojtasik Pawel18,00028Khezam Rene-18,000
16311Trinkl Matthias18,0002Diviš Martin-18,0003Diviš Carrie18,0004Beck Daniel-18,000
17325Hoskovec David9,0006Bílek Lukáš-18,0007Konderlová Jana9,0008Berkman Tadeáš-18,000
18339Trmal Vojtěch-12,00010Duraković Zijad-18,00011Kruse Markus-12,00012Frings Jonas-18,000
193413Rappe Marco-20,00014Schlich Manuel-18,00015Völker Marcus-20,00016Hahn Timur-18,000
203517Kammer Stefanie-1,00018Laube Waldemar-18,00019Rus Joaquin Derrac-1,00020Huynh Joe-Calberson-18,000
213621Trepinska Karolina9,00022Debrun Luc-18,00023Potmeer Pieter9,00024Arendarski Bartosz-18,000
223725Zieliński Tomasz-5,00026Chabelska Katarzyna-18,00027Wojtasik Pawel-5,00028Khezam Rene-18,000
23411Trinkl Matthias-19,0002Diviš Martin-18,0003Diviš Carrie-19,0004Beck Daniel-18,000
24425Hoskovec David-20,0006Bílek Lukáš-18,0007Konderlová Jana-20,0008Berkman Tadeáš-18,000
25439Trmal Vojtěch20,00010Duraković Zijad-18,00011Kruse Markus20,00012Frings Jonas-18,000
264413Rappe Marco14,00014Schlich Manuel-18,00015Völker Marcus14,00016Hahn Timur-18,000
274517Kammer Stefanie-11,00018Laube Waldemar-18,00019Rus Joaquin Derrac-11,00020Huynh Joe-Calberson-18,000
284621Trepinska Karolina3,00022Debrun Luc-18,00023Potmeer Pieter3,00024Arendarski Bartosz-18,000
294725Zieliński Tomasz-2,00026Chabelska Katarzyna-18,00027Wojtasik Pawel-2,00028Khezam Rene-18,000
30
31IDNAME1234Total
321Trinkl Matthias-18,0008,00018,000-19,000-11,000
332Diviš Martin-18,000-18,000-18,000-18,000-72,000
343Diviš Carrie-18,0008,00018,000-19,000-11,000
354Beck Daniel-18,000-18,000-18,000-18,000-72,000
365Hoskovec David15,000-9,0009,000-20,000-5,000
376Bílek Lukáš-18,000-18,000-18,000-18,000-72,000
387Konderlová Jana15,000-9,0009,000-20,000-5,000
398Berkman Tadeáš-18,000-18,000-18,000-18,000-72,000
409Trmal Vojtěch13,000-1,000-12,00020,00020,000
4110Duraković Zijad-18,000-18,000-18,000-18,000-72,000
4211Kruse Markus13,000-1,000-12,00020,00020,000
4312Frings Jonas-18,000-18,000-18,000-18,000-72,000
4413Rappe Marco12,000-11,000-20,00014,000-5,000
4514Schlich Manuel-18,000-18,000-18,000-18,000-72,000
4615Völker Marcus12,000-11,000-20,00014,000-5,000
4716Hahn Timur-18,000-18,000-18,000-18,000-72,000
4817Kammer Stefanie-2,00015,000-1,000-11,0001,000
4918Laube Waldemar-18,000-18,000-18,000-18,000-72,000
5019Rus Joaquin Derrac-2,00015,000-1,000-11,0001,000
5120Huynh Joe-Calberson-18,000-18,000-18,000-18,000-72,000
5221Trepinska Karolina-16,000-4,0009,0003,000-8,000
5322Debrun Luc-18,000-18,000-18,000-18,000-72,000
5423Potmeer Pieter-16,000-4,0009,0003,000-8,000
5524Arendarski Bartosz-18,000-18,000-18,000-18,000-72,000
5625Zieliński Tomasz3,00018,000-5,000-2,00014,000
5726Chabelska Katarzyna-18,000-18,000-18,000-18,000-72,000
5827Wojtasik Pawel3,00018,000-5,000-2,00014,000
5928Khezam Rene-18,000-18,000-18,000-18,000-72,000
Sheet2


Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    RC = Table.RemoveColumns(Source,{"table"}),
    Type = Table.TransformColumnTypes(RC,{{"round", Int64.Type}, {"p1 ID", Int64.Type}, {"p1 score", Int64.Type}, {"p2 score", Int64.Type}, {"p2 ID", Int64.Type}, {"p3 ID", Int64.Type}, {"p3 score", Int64.Type}, {"p4 ID", Int64.Type}, {"p4 score", Int64.Type}}),
    UP = Table.UnpivotOtherColumns(Type, {"round"}, "Attribute", "Value"),
    Trim = Table.TransformColumns(UP,{{"Attribute", each Text.Upper(Text.Split(_," "){1})}}),
    Index = Table.AddIndexColumn(Trim, "Index", 0, 1, Int64.Type),
    aCNT = List.Count(List.Distinct(Index[Attribute])),
    IntDiv = Table.TransformColumns(Index, {{"Index", each Number.IntegerDivide(_, aCNT), Int64.Type}}),
    Pivot = Table.Pivot(IntDiv, List.Distinct(IntDiv[Attribute]), "Attribute", "Value"),
    RemoveIndex = Table.RemoveColumns(Pivot,{"Index"}),
    Pivot1 = Table.Pivot(Table.TransformColumnTypes(RemoveIndex, {{"round", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(RemoveIndex, {{"round", type text}}, "en-US")[round]), "round", "SCORE", List.Sum),
    Total = Table.AddColumn(Pivot1, "Total", each List.Sum(List.Skip(Record.FieldValues(_),Table.ColumnCount(RemoveIndex)-aCNT+1)))
in
    Total
 
Upvote 0
Country and EMA come from a different sheet as full identifiers for the players.
The results table is shorter to be more clear to read and write into. players names in "score" sheet are VLOOKUP from another sheet with some added cells to make sure there are no mistakes.
the "results" sheet is then a compilation of data from about 3 or 4 other sheets.
Your power query looks elegant, but I don't know how to put it in function - I don't know much about functions in Excel and I'm using only a couple of them on regular basis.
Do you have another possible solution for this that does not include Power query?
One more thing, the amount of tables per round can change given the amount of players in the tournament, but will never change throughout.
 
Upvote 0
Is there a possibility of using Named areas and VLOOKUP function?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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