Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert matrix to 3-column table ('reverse pivot', 'unpivot', 'flatten', 'normalize')

I need to convert the Excel matrix FIRST in the table LATER:

FIRST:

    P1  P2  P3  P4 F1  X F2  X   X F3      X       X F4      X   X 

LATER:

F   P   VALUE F1  P1  X F1  P2 F1  P3 F1  P4 F2  P1  X F2  P2  X F2  P3 F2  P4 F3  P1 F3  P2  X F3  P3 F3  P4  X F4  P1 F4  P2  X F4  P3  X F4  P4 
like image 919
user3095042 Avatar asked Dec 12 '13 11:12

user3095042


People also ask

How do I convert a matrix table to three columns in Excel?

Choose Cross table to list option under Transpose type. button under Source range to select the data range that you want to convert. button under Results range to select a cell where you want to put the result.

How do I convert a matrix table to three columns in Excel for Mac?

For Excel for Mac 2011, it's ⌘ + Alt + P (See here). Select Multiple consolidation ranges and click Next . In “Step 2a of 3”, choose I will create the page fields and click Next . In “Step 2b of 3” specify your summary table range in the Range field (A1:E5 for the sample data) and click Add , then Next .

How do you reverse a pivot table in Excel?

Press Alt + D + P shortcut keys to open PivotTable and PivotChart Wizard dialog, then, check Multiple consolidation ranges option under Where is the data that you want to analyze section and PivotTable option under What kind of report do you want to create section.


1 Answers

To “reverse pivot”, “unpivot” or “flatten”:

  1. For Excel 2003: Activate any cell in your summary table and choose Data - PivotTable and PivotChart Report:

    SO20541905 first example

For later versions access the Wizard with Alt+D, P.

For Excel for Mac 2011, it's +Alt+P (See here).

  1. Select Multiple consolidation ranges and click Next.

    SO20541905 second example

  2. In “Step 2a of 3”, choose I will create the page fields and click Next.

    SO20541905 third example

  3. In “Step 2b of 3” specify your summary table range in the Range field (A1:E5 for the sample data) and click Add, then Next.

    SO20541905 fourth example

  4. In “Step 3 of 3”, select a location for the pivot table (the existing sheet should serve, as the PT is only required temporarily):

    SO20541905 fifth example

  5. Click Finish to create the pivot table:

    SO20541905 sixth example

  6. Drill down (ie double-click) on the intersect of the Grand Totals (here Cell V7 or 7):

    SO20541905 seventh example

  7. The PT may now be deleted.

  8. The resulting Table may be converted to a conventional array of cells by selecting Table in the Quick Menu (right-click in the Table) and Convert to Range.

There is a video on the same subject at Launch Excel which I consider excellent quality.

like image 194
pnuts Avatar answered Sep 18 '22 13:09

pnuts