SmartQueryTools

Unpivot Excel Files Online

Reshape Excel files from wide to long format directly in your browser. Melt multiple columns into variable/value pairs — no upload required.

How to unpivot Excel files

  1. Drop your file. The first column is ticked as an ID column by default.
  2. Tick every column that identifies a row, such as an ID, a name or a region. ID columns are repeated on every output row.
  3. Leave the columns you want to melt unticked. Each unticked column becomes rows holding its column name and its value.
  4. Name the two new columns. They default to variable and value.
  5. Click Unpivot, check the long-format preview, and download the result.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Worked example

An HR team runs a two-question pulse survey. The export has one row per respondent and one column per question, but the dashboard tool wants one row per answer. One respondent skipped the second question.

Input (Excel)

Excel workbook, first sheet (Sheet1)

respondent_idteamq1_scoreq2_score
1041Support45
1042Sales2NULL
1043Support54

Settings

  • ID columns (ticked): respondent_id, team
  • Value columns (unticked): q1_score, q2_score
  • Variable column name: question
  • Value column name: score

Result

respondent_idteamquestionscore
1041Supportq1_score4
1041Supportq2_score5
1042Salesq1_score2
1042Salesq2_scoreNULL
1043Supportq1_score5
1043Supportq2_score4

Each respondent now has one row per question, with the ID columns repeated. Respondent 1042 skipped question 2, and that row is kept with an empty score. So the result has 6 rows, 3 respondents times 2 questions. Filter out empty scores afterwards if you only want answered questions.

Working with Excel files

Wide layouts are common in Excel: one row per product and one column per month, often with a Total column at the end. Remove the total before unpivoting, with Select columns or in Excel. If you leave it unticked, "Total" becomes one of the values in the variable column, mixed in with the months. Only the first sheet is read, and cells are loaded as the text they display. A month column formatted as currency therefore loads as text and will not stack with plain number columns.

Header cells holding real dates are written as ISO text, so a header showing Jan-26 becomes the value 2026-01-01 in the variable column. A header typed as text stays as typed. Title rows above the header, often merged across the table, break the header detection. Delete them so the column names sit in row 1. The result is written to a new workbook on Sheet1. Watch the row count, because a sheet holds at most 1,048,576 rows and unpivoting can pass that. If it might, convert the workbook to CSV or Parquet first and unpivot that file.

Frequently Asked Questions

How do I keep a Total column out of the unpivoted Excel file?

Delete it in Excel, or drop it with the Select columns tool, before unpivoting. Ticking it as an ID column is the other option, but then the total is repeated on every row.

Why is my month header not a date after unpivoting?

Headers always end up as text in the variable column. A real date header arrives as text like 2026-01-01, which Parse Dates turns into a date. A header typed as the text Jan-26 needs a custom pattern such as %b-%y.

Are empty values kept?

Yes. Each input row gives one output row for every value column, even when the value is empty (NULL). Filter the value column afterwards if you want only filled values.

Can I unpivot columns of different types?

Yes. Whole numbers and decimals combine into a number column, and dates and timestamps into timestamps. Any other mix, such as numbers and text, is converted to text so the run still works.

How do I go back from long to wide?

Use the Pivot tool. Put the variable column into the column headers and use the value column for the cells.

Related Tools