ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Productivity
  3. Unpivot Data in Excel With Power Query

Unpivot Data in Excel With Power Query

By ExcelReady Team·Updated November 3, 2026·4 min read

The short answer

To unpivot data in Excel, select a cell in the table, choose Data > From Table/Range to open Power Query, select the label columns such as Region, then choose Transform > Unpivot Columns > Unpivot Other Columns. Rename Attribute and Value, then click Close & Load. Each month column becomes rows in one long table.

Key takeaways

  • Unpivoting turns a wide table (one column per month) into a long table (one row per region and month).
  • In Power Query, select the columns to keep and choose Unpivot Other Columns, so new months are included on refresh.
  • Rename the Attribute and Value columns before you load the result.
  • Long data works much better with pivot tables, SUMIFS and charts than wide data.
On this page+
  1. What does unpivot mean?
  2. Why unpivot data before you analyse it?
  3. How to unpivot data in Excel with Power Query
  4. Unpivot Columns vs Unpivot Other Columns
  5. Refresh the unpivoted table when data changes
  6. How to unpivot data with formulas
  7. Practise it

To unpivot data in Excel, load the table into Power Query, select the columns you want to keep, and choose Unpivot Other Columns. Every month (or product, or year) column turns into rows, so you get one long list that pivot tables and SUMIFS can read. This guide is for anyone who receives reports with a column for every month and needs to analyse them properly.

What does unpivot mean?#

Unpivoting turns a wide table into a long one. A wide table has one column per month. A long table has one row per region and month, with the month name in its own column.

Here is a wide table, the kind you often get from a budget or a report:

RegionJanFebMar
North120135150
South9011095

And here is the same data unpivoted:

RegionMonthSales
NorthJan120
NorthFeb135
NorthMar150
SouthJan90
SouthFeb110
SouthMar95

Nothing was added or lost: six numbers in, six numbers out. Unpivoting is not the same as transposing. Transpose just flips rows and columns, so the table is still wide, only sideways.

Why unpivot data before you analyse it?#

Most Excel tools expect long data, with one value per row and one column per kind of information. With the long table:

  • A pivot table can put Month in Rows or Columns, filter to one month, or total by region with no extra work.
  • SUMIFS needs one column to check. "Total for Feb" is =SUMIFS(C2:C7,B2:B7,"Feb"), which returns 245 (135 + 110).
  • Adding April means adding rows, not a new column that every formula must learn about.

With the wide table, each month is a different column, so every month needs its own formula, and a pivot table treats Jan, Feb and Mar as three separate fields. The beginner's guide to pivot tables explains why pivots want one column per field.

How to unpivot data in Excel with Power Query#

Power Query is Excel's built-in tool for importing and reshaping data in recorded steps. It's on the Data tab in Excel 2016 and later and Microsoft 365. The Power Query guide for beginners gives a full tour. To unpivot:

  1. Click any cell in the wide table.
  2. Go to Data > From Table/Range. If Excel asks to create a table, check that My table has headers is ticked and click OK.
  3. The Power Query Editor opens. Click the Region column header. To keep more than one label column, hold Ctrl (Mac: ⌘) and click each one.
  4. Go to Transform > Unpivot Columns (click the small arrow) and choose Unpivot Other Columns. You can also right-click the selected header and pick it there.
  5. Power Query creates two new columns, Attribute (the old headers) and Value (the numbers). Double-click each header and rename them Month and Sales.
  6. Click Home > Close & Load. The long table lands on a new sheet.

If the old headers were dates, check the Month column's data type in the editor (the small icon on the header) so Excel treats them as dates, not text.

Unpivot Columns vs Unpivot Other Columns#

Both commands give the same result today. The difference shows up next month.

  • Unpivot Columns unpivots only the columns you selected (Jan, Feb, Mar). When April arrives, it is left as a separate column.
  • Unpivot Other Columns unpivots everything except the columns you selected (Region). When April arrives, it is unpivoted too.

So select the label columns and use Unpivot Other Columns. It's the safer habit for any report that grows.

Refresh the unpivoted table when data changes#

The query remembers every step. When the wide table gets new rows or a new month column, go to Data > Refresh All (Windows: Ctrl+Alt+F5) and the long table rebuilds itself. You never repeat the clicks.

This repeatability is the main reason to use Power Query over a manual copy and paste. The article on Power Query vs formulas compares the two approaches in more depth. The same tool can also combine sheets into one table before you unpivot them.

How to unpivot data with formulas#

If Power Query isn't available, for example in an older version of Excel for Mac, formulas can rebuild the long table. Put the numbers 1 to 6 in a helper column, say F2:F7 (two regions × three months). Then, in row 2:

Excel formula
Region: =INDEX($A$2:$A$3,INT((F2-1)/3)+1)
Month:  =INDEX($B$1:$D$1,MOD(F2-1,3)+1)
Sales:  =INDEX($B$2:$D$3,INT((F2-1)/3)+1,MOD(F2-1,3)+1)

Fill the three formulas down. The 3 is the number of month columns. INT((n−1)/3)+1 moves to the next region every three rows, and MOD(n−1,3)+1 cycles through months 1, 2, 3. For n = 5 the formulas return South, Feb and 110.

This works in every version, but you must update the ranges and the 3 by hand when months are added. Microsoft 365 also has a TOCOL function that stacks a block of values into one column, which shortens the job.

Practise it#

Once your data is long, summarising it is the easy part. Build your first pivot table in a live spreadsheet: you drag the fields and each step is checked instantly. Then try the pivot-style summary with formulas lesson, which builds a summary from a long table with UNIQUE and SUMIFS. Start with the SUMIFS exercise on this page.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

This table is already unpivoted into long form. Click E2 and use SUMIFS to total the Sales (C2:C7) for the month Feb (Month is B2:B7).

fx
ABCDEF
1
Region
Month
Sales
2
North
Jan
120
Feb total
3
North
Feb
135
4
North
Mar
150
5
South
Jan
90
6
South
Feb
110
7
South
Mar
95
8
9
10

Tip: Start with the Sales column, then the Month column and "Feb" in quotes.

Practise this in a lesson

LessonPivot tables 1Build your first PivotTable on a new sheet: total sales by region, split them by product, then switch the summary from Sum to Count and Average and read the answer off the pivot.LessonPivot-style summary with formulasBuild a summary table like a pivot table with formulas: a sorted UNIQUE list of categories, then SUMIFS and COUNTIFS filled down beside it.

Frequently asked questions

What does unpivot mean in Excel?

+

Unpivot means turning several value columns, such as Jan, Feb and Mar, into rows. You end up with one column for the old headers (Month) and one for the values (Sales).

How do I unpivot data in Excel without Power Query?

+

Use formulas: INDEX with INT and MOD can rebuild the long table one row at a time. For a one-off job on a small table, you can also copy and paste the blocks by hand.

What is the difference between Unpivot Columns and Unpivot Other Columns?

+

Unpivot Columns unpivots only the columns you selected. Unpivot Other Columns unpivots everything except the columns you selected, so new month columns are unpivoted automatically on refresh.

Is unpivot the same as transpose?

+

No. Transpose flips rows and columns, so the table stays wide, just turned sideways. Unpivot stacks the value columns into rows, which gives a long list with one value per row.

Can I unpivot data in Excel for Mac?

+

Excel for Microsoft 365 on Mac includes the Power Query editor in recent versions, with From Table/Range and Unpivot. Older Mac versions don't, so use the formula method there.

Sources

  • Create a PivotTable to analyze worksheet data - Microsoft Support
  • INDEX function - Microsoft Support
  • SUMIFS function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 3, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. What does unpivot mean?
  2. Why unpivot data before you analyse it?
  3. How to unpivot data in Excel with Power Query
  4. Unpivot Columns vs Unpivot Other Columns
  5. Refresh the unpivoted table when data changes
  6. How to unpivot data with formulas
  7. Practise it

Keep reading

Productivity· 6 min read

Power Query in Excel for Beginners: What It Does

Power Query is Excel's built-in tool for importing and cleaning data. You load data from a table, file or folder, fix it with commands such as Trim, Split Column and Remove Duplicates, and Excel records each step. Click Refresh and every step runs again on new data. Find it on the Data tab, under Get & Transform Data.

Comparisons· 7 min read

Power Query vs Formulas: When to Use Each in Excel

Use Power Query when you import and clean the same kind of data again and again, from files, folders or large tables: you record the steps once and click Refresh. Use formulas when the data already sits in the sheet, the job is small, or results must update the moment a cell changes. Many good workbooks use both.

Data tools· 5 min read

Pivot Tables in Excel: A Beginner's Guide

A pivot table summarizes a long table in a few clicks, without formulas. Click a cell in your data, choose Insert > PivotTable, and click OK to put it on a new sheet. Then drag fields into Rows, Columns and Values: Region in Rows and Sales in Values gives total sales for each region.

More on productivity

  • View Two Excel Sheets Side by Side
  • What-If Analysis in Excel: Build a Data Table
  • How to Use ChatGPT for Excel Formulas (and Check Them)
  • Copilot in Excel: What It Does and What You Still Need
  • How to Enable the Analysis ToolPak in Excel and Use It
  • Apply a Formula to an Entire Column in Excel
All productivity articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free