Pivot table example Pivot tables are a useful tool for organizing data in excel. To make a pivot table: 1. Select your data (for this demo, use the data in the "face detection task data" worksheet). Make sure you include the titles in the top row! 2. Choose Pivot Table from the Data menu (Excel 2003) or the Insert tab (Excel 2007). 3. Click Next, OK, or Finish on every screen of the Pivot Table Wizard to use all of the default settings and make a new worksheet which contains your pivot table. 4. In Excel 2003, you can just click and drag your data onto the pivot table. In this example, we want to see the average RT for each subject for each condition and target type: Drag "Subject" to the "Row Fields" section on the left side of the pivot table. This will organize the table so that every row is a subject. Drag "Condition" and "Target" to the "Column Fields" section on top of the pivot table. Note that you can drag these right and left so that either Condition or Target is first. Drag "RT" to the "Data Items" section in the middle of the table. Notice that in the upper corner it says "Sum of RT". That's not really what you want to see. Right‐click this, choose "Field Settings" and change it to average of RT. 5. You're done! If you want to change something in the pivot table, just click anywhere on the table to see the drag‐and‐drop interface again. WARNING: If you edit the original data, Excel does not automatically update your pivot table. You have to do this manually by right‐clicking on the table and choosing Refresh Data. The pivot table for the face detection task data is shown below: Average o Condition Target easy Subject angryFace happyFace neutralFace 1 2 3 562.9 655.4 756.2 4 563.8 650.7 741.4 5 546.5 650.4 752.8 6 Grand Tot 557.7333333 652.1666667 750.1333333 easy Total 658.1666667 651.9666667 649.9 653.3444444 hard angryFace happyFace neutralFace 557.3 650.7 743.3 569.4 646.7 765.9 560.5 642.9 748.2 hard Total Grand Total 650.4333333 650.4333333 660.6666667 660.6666667 650.5333333 650.5333333 658.1666667 651.9666667 649.9 562.4 646.7666667 752.4666667 653.8777778 653.6111111 In this (made‐up) experiment, each subject was trying to detect a face that differed from a crowd of distractor faces in its emotion (it was the only happy face, only angry face, or only neutral face in the crowd). In addition, subjects were sorted into one of two conditions (easy search or hard search). Because "Condition" is a between‐subjects variable, the pivot table has some blank spaces. More tutorials: http://www.ozgrid.com/Excel/PivotTables/ExCreatePiv1.htm http://chandoo.org/wp/2009/08/19/excel‐pivot‐tables‐tutorial/ (for Excel 2007) Subject Trial 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 Condition hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard Target neutralFace neutralFace happyFace angryFace neutralFace angryFace neutralFace angryFace neutralFace happyFace angryFace happyFace angryFace happyFace neutralFace neutralFace angryFace angryFace angryFace neutralFace happyFace neutralFace angryFace happyFace angryFace happyFace happyFace neutralFace happyFace happyFace angryFace happyFace angryFace RT 714 772 623 518 795 508 740 568 724 695 597 668 534 647 713 721 585 582 552 761 609 787 578 631 551 696 670 706 655 613 560 646 597 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard angryFace happyFace happyFace happyFace angryFace happyFace angryFace angryFace neutralFace neutralFace neutralFace neutralFace neutralFace neutralFace angryFace neutralFace happyFace happyFace neutralFace angryFace happyFace angryFace neutralFace happyFace neutralFace happyFace angryFace neutralFace angryFace happyFace happyFace neutralFace happyFace neutralFace 514 669 652 619 561 614 585 559 747 777 786 743 759 740 592 766 653 696 796 590 633 578 776 612 769 673 558 792 580 607 652 768 618 762 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard hard easy easy easy easy easy easy easy easy easy easy easy angryFace neutralFace neutralFace angryFace happyFace neutralFace happyFace angryFace angryFace happyFace happyFace happyFace happyFace neutralFace angryFace neutralFace angryFace neutralFace angryFace angryFace neutralFace happyFace angryFace happyFace angryFace neutralFace neutralFace neutralFace happyFace angryFace angryFace happyFace angryFace neutralFace 562 722 783 551 681 707 603 516 591 652 693 682 609 707 595 712 515 765 547 557 764 632 591 653 590 737 720 781 664 541 566 627 550 732 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy happyFace angryFace neutralFace happyFace angryFace neutralFace angryFace neutralFace angryFace neutralFace happyFace angryFace happyFace angryFace happyFace neutralFace neutralFace happyFace happyFace happyFace happyFace angryFace angryFace angryFace neutralFace neutralFace angryFace happyFace angryFace happyFace neutralFace angryFace neutralFace happyFace 674 534 796 611 558 782 571 748 525 761 695 597 665 597 664 764 741 624 677 668 663 537 537 557 793 734 568 626 597 635 729 589 702 656 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy easy neutralFace angryFace happyFace happyFace happyFace neutralFace angryFace happyFace neutralFace happyFace neutralFace angryFace neutralFace angryFace neutralFace neutralFace neutralFace neutralFace neutralFace happyFace angryFace angryFace happyFace neutralFace neutralFace angryFace angryFace happyFace neutralFace happyFace happyFace angryFace happyFace happyFace 786 561 627 682 696 768 521 646 749 608 706 574 728 597 719 748 754 777 730 611 546 521 602 719 789 555 507 669 734 686 690 590 613 692 6 6 6 6 6 6 6 6 6 6 6 20 21 22 23 24 25 26 27 28 29 30 easy easy easy easy easy easy easy easy easy easy easy angryFace angryFace happyFace happyFace angryFace neutralFace neutralFace happyFace angryFace angryFace neutralFace 591 554 641 676 544 736 799 624 527 530 742 MIT OpenCourseWare http://ocw.mit.edu 9.63 Laboratory in Visual Cognition Fall 2009 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.