简体   繁体   English

将Excel表转换为X列和Y列

[英]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.

相关问题 Excel自动填充列X +++ .. Y ++ .. Z + - Excel auto fill column by X+++..Y++..Z+ 在excel中将两列列表转换为表格 - Convert two column list to a table in excel 将Excel Power查询表列转换为字符串 - Convert Excel power query table column to string Excel 仪表板中的表格数据 Excel 仪表板按一列作为 x 轴和其他列的总和作为 y 轴分组 - Excel sheet data in Excel dashboard grouping by one column as x axis and sum of other column as y axis 如何在 excel 中将 N 列表转换为两列表 - How to convert convert a N columns table to two column table in excel 如何将多列 excel 表转换为附有 header 的单列 - How to convert multi column excel table to single column with header attached Excel公式:如果列B的值在X和Y之间,则添加列A的值 - Excel formula: Add Column A value if Column B value is between X and Y Excel - 如何获得其中一列中的值为 X 而另一列中的值为 Y 的单元格的平均值? - Excel - How can I get the average of cells where the value in one column is X and the value in another column is Y? Excel 公式可以在colors的基础上在Q,V,W,X,Y,Z列写出具体的列 - Excel formula which can write specific column on the basis of colors in column Q,V,W,X,Y,Z Excel-在X列中查找最后一个相同的值,并将Y列添加到当前单元格 - Excel - Find last same value in Column X and add Column Y to current cell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM