Unpivot transforms a wide table — where each measurement occupies a separate column — into a long table where all values stack vertically under two standardized columns: a variable column (the former header) and a value column (the cell content). This transformation is essential for any tool that filters, groups, charts, or models data by category or time period.
Worked Example
Consider a sales report where each month is a separate column:
| Employee | Jan | Feb | Mar | Apr |
| Alice | 1200 | 1350 | 1100 | 1450 |
| Bob | 980 | 1020 | 1150 | 1300 |
| Carol | 1400 | 1280 | 1500 | 1600 |
After unpivoting with "Employee" as the ID column and "Jan, Feb, Mar, Apr" as value columns:
| Employee | Month | Sales |
| Alice | Jan | 1200 |
| Alice | Feb | 1350 |
| Alice | Mar | 1100 |
| Alice | Apr | 1450 |
| Bob | Jan | 980 |
| Bob | Feb | 1020 |
| Bob | Mar | 1150 |
| Bob | Apr | 1300 |
| Carol | Jan | 1400 |
| Carol | Feb | 1280 |
| Carol | Mar | 1500 |
| Carol | Apr | 1600 |
What happened mechanically: the tool identified Employee as the ID column (kept as rows), then treated Jan, Feb, Mar, Apr as value columns. For each row, it created one output row per value column — placing the header name into "Month" and the cell value into "Sales." The result has more rows but is now ready for pivot tables, line charts, and SQL GROUP BY queries.
When to Unpivot Your Data
- Your data has repeating period headers (months, quarters, years) across columns.
- You need to create charts that compare categories over time.
- You plan to load data into a database, BI tool, or statistical software.
- Pivot tables or aggregations produce errors because data is spread across too many columns.
Our tool handles merged cells, multi-level headers, and mixed data types automatically. Paste or upload your file, select which columns to keep and which to unpivot, then download the result as Excel or CSV.