[英]Convert an Excel table to X column and Y column
I currently have an Excel table which I need it to be split into a XY table. 我目前有一个Excel表,需要将其拆分为XY表。
Excel table: Excel表格:
Name NameDesc Ability AbilityDesc
-------------------------------------------------
12345 LongName1 Tennis Whack balls 1
12345 LongName1 Golf Whack balls 2
23456 LongName2 Swim Like a fish
23456 LongName2 Run Like a cheetah
34567 LongName3 Gaming Starcraft
45678 LongName4 Run Like a cheetah
45678 LongName4 Golf Whack balls 2
Output table: 输出表:
12345 23456 34567 45678
---------------------------------------------
Tennis X
Golf X X
Swim X
Run X X
Gaming X
Is there a function in Excel that I can use? 我可以使用Excel中的功能吗? Or do I need to go VBA?
还是我需要VBA?
It can be arranged without a PivotTable but then a helper column is useful to distinguish between valid entries for a lookup. 可以在不使用数据透视表的情况下安排它,但是帮助器列对于区分有效的查找项很有用。 Say add a column (say A) containing
=B2&" | "&D2
copied down to suit and, assuming Name
label is in B1 and your output table (already labelled for row and column) starts in J1: 假设添加一列(比如说A),其中包含
=B2&" | "&D2
复制到适合的位置,并假设Name
标签在B1中,并且您的输出表(已经在行和列中进行了标签)从J1开始:
=IFERROR(IF(VLOOKUP(K$1&" | "&$J2,$A:$D,4,0)=$J2,"X",""),"")
in K2 copied across and down as applicable might suit. 在K2中复制(如果适用)来回复制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.