I have a tabular report, also called a matrix or "crosstab". For example, in the column headers, the name of the customer is indicated, in the headings of the lines the name of the product and in the intersection the number of products sold to each customer.
+---+------------+-----------+-----------+-----------+ | | A | B | C | D | +---+------------+-----------+-----------+-----------+ | 1 | | Cliente 1 | Cliente 2 | Cliente 3 | | 2 | Producto 1 | 4 | 2 | 6 | | 3 | Producto 2 | 7 | 8 | 6 | | 4 | Producto 3 | 6 | 3 | 5 | | 5 | Producto 4 | 3 | 3 | 8 | +---+------------+-----------+-----------+-----------+
I need to pass the data to a simple table format, that is, a column for row headers, a column for column headings and a column for values, as shown below:
+----+---------------------+------------------------+---------+ | | A | B | C | +----+---------------------+------------------------+---------+ | 1 | Encabezados de fila | Encabezados de columna | Valores | | 2 | Producto 1 | Cliente 1 | 4 | | 3 | Producto 2 | Cliente 2 | 8 | | 4 | Producto 3 | Cliente 3 | 5 | | 5 | Producto 4 | Cliente 1 | 3 | | 6 | Producto 1 | Cliente 2 | 2 | | 7 | Producto 2 | Cliente 3 | 6 | | 8 | Producto 3 | Cliente 1 | 6 | | 9 | Producto 4 | Cliente 2 | 3 | | 10 | Producto 1 | Cliente 3 | 6 | | 11 | Producto 2 | Cliente 1 | 7 | | 12 | Producto 3 | Cliente 2 | 3 | | 13 | Producto 4 | Cliente 3 | 8 | +----+---------------------+------------------------+---------+
How can I achieve this using Google's spreadsheet functions?
Clarifications
Inspired question How do you create a "reverse pivot" in Google Sheets? - Stack Overflow and in personal experience.