У меня есть лист с данными, похожими на следующие:

P1_ShipType         P2_ShipType         RoundTime
Kus_AssaultFrigate  Tai_AssaultFrigate  117
Kus_AssaultFrigate  Tai_AttackBomber    17
Kus_AssaultFrigate  Tai_Carrier         1191
Kus_AttackBomber    Tai_AssaultFrigate  2775
Kus_AttackBomber    Tai_AttackBomber    18
Kus_AttackBomber    Tai_Carrier         0
Kus_Carrier         Tai_AssaultFrigate  1354
Kus_Carrier         Tai_AttackBomber    8
Kus_Carrier         Tai_Carrier         0

Как мне "повернуть" таблицу так, чтобы она выглядела так:

                    Tai_AssaultFrigate      Tai_AttackBomber        Tai_Carrier
Kus_AssaultFrigate  117                     17                      1191
Kus_AttackBomber    2775                    18                      0
Kus_Carrier         1354                    8                       0

Спасибо!

[редактировать]

Но что, если в RoundTime есть несколько столбцов?

P1_ShipType             P1_Research     P2_ShipType             P2_Research     RoundTime
Kus_AssaultFrigate      guns            Tai_AssaultFrigate      guns            48
Kus_AssaultFrigate      guns            Tai_AttackBomber        guns            11
Kus_AssaultFrigate      guns            Tai_Carrier             guns            38
Kus_AttackBomber        guns            Tai_AssaultFrigate      guns            62
Kus_AttackBomber        guns            Tai_AttackBomber        guns            70
Kus_AttackBomber        guns            Tai_Carrier             guns            69
Kus_Carrier             guns            Tai_AssaultFrigate      guns            5
Kus_Carrier             guns            Tai_AttackBomber        guns            84
Kus_Carrier             guns            Tai_Carrier             guns            77
Kus_AssaultFrigate      guns            Tai_AssaultFrigate      engines         83
Kus_AssaultFrigate      guns            Tai_AttackBomber        engines         82
Kus_AssaultFrigate      guns            Tai_Carrier             engines         29
Kus_AttackBomber        guns            Tai_AssaultFrigate      engines         97
Kus_AttackBomber        guns            Tai_AttackBomber        engines         22
Kus_AttackBomber        guns            Tai_Carrier             engines         10
Kus_Carrier             guns            Tai_AssaultFrigate      engines         71
Kus_Carrier             guns            Tai_AttackBomber        engines         3
Kus_Carrier             guns            Tai_Carrier             engines         38
Kus_AssaultFrigate      engines         Tai_AssaultFrigate      guns            34
Kus_AssaultFrigate      engines         Tai_AttackBomber        guns            21
Kus_AssaultFrigate      engines         Tai_Carrier             guns            84
Kus_AttackBomber        engines         Tai_AssaultFrigate      guns            51
Kus_AttackBomber        engines         Tai_AttackBomber        guns            73
Kus_AttackBomber        engines         Tai_Carrier             guns            27
Kus_Carrier             engines         Tai_AssaultFrigate      guns            66
Kus_Carrier             engines         Tai_AttackBomber        guns            82
Kus_Carrier             engines         Tai_Carrier             guns            22
Kus_AssaultFrigate      engines         Tai_AssaultFrigate      engines         10
Kus_AssaultFrigate      engines         Tai_AttackBomber        engines         63
Kus_AssaultFrigate      engines         Tai_Carrier             engines         2
Kus_AttackBomber        engines         Tai_AssaultFrigate      engines         94
Kus_AttackBomber        engines         Tai_AttackBomber        engines         44
Kus_AttackBomber        engines         Tai_Carrier             engines         93
Kus_Carrier             engines         Tai_AssaultFrigate      engines         5
Kus_Carrier             engines         Tai_AttackBomber        engines         53
Kus_Carrier             engines         Tai_Carrier             engines         80

Вот как должен выглядеть результат:

                                                Tai_AssaultFrigate      Tai_AttackBomber        Tai_Carrier     Tai_AssaultFrigate      Tai_AttackBomber        Tai_Carrier
                                                guns                    guns                    guns            engines                 engines                 engines
Kus_AssaultFrigate  guns                        117                     17                      1191            117                     17                      1191
Kus_AttackBomber    guns                        2775                    18                      0               2775                    18                      0
Kus_Carrier         guns                        1354                    8                       0               1354                    8                       0
Kus_AssaultFrigate  engines                     117                     17                      1191            117                     17                      1191
Kus_AttackBomber    engines                     2775                    18                      0               2775                    18                      0
Kus_Carrier         engines                     1354                    8                       0               1354                    8                       0

1 ответ1

2

Siply вы можете выбрать диапазон данных, а затем в Excel;

Insert--> Pivot Table.

Затем выберите поля данных, как показано ниже.

Row Lables --> P1_ShipType
Column LAble -->P2_ShipType
Values --> Round Time

Пожалуйста, обратитесь скриншоты

Сводная таблица

Выход

FOrmatting и Всего удалено

Сводная таблица может быть перестроена по желанию с помощью доступных столбцов. Вот один из примеров.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .