使用另一列中的键值旋转一列中的值

时间:2014-12-20 20:21:44

标签: excel excel-formula match pivot-table worksheet-function

我想将Program列转换为与数据中的值(在示例中为三个)一样多的新列,然后根据ID列合并行:

ID          Program
50000001    English Language Learner (ELL)
50000001    Free and Reduced Lunch (FRL)
50000002    English Language Learner (ELL)
50000002    Free and Reduced Lunch (FRL)
50000002    Special Education (SPED)
50000003    Special Education (SPED)

这就是我想要的:

ID          English Language Learner (ELL)  Free and Reduced Lunch (FRL)    Special Education (SPED)
50000001    English Language Learner (ELL)  Free and Reduced Lunch (FRL)
50000002    English Language Learner (ELL)  Free and Reduced Lunch (FRL)    Special Education (SPED)
50000003                                                                    Special Education (SPED)

我很久以前就用Excel直接或使用KUTOOLS做了这个,但不记得是怎么做的。

1 个答案:

答案 0 :(得分:0)

假设您可以将行标签和列标签创建为唯一列表,并将列添加到"我拥有的内容"将这些连接起来(比如像=A2&B2之类的东西)并将你命名为Clist,然后以下内容可以在第一个数字ID与第一个程序的交集处起作用(因为假设为B2)在另一张表格中,横向和向下复制以适应:

=IFERROR(IF(MATCH($A2&B$1,Clist,0)>0,B$1,),"")