Pinterest Pixel

Process Flat Data Using Modulo in Power Query

Power Query or Get & Transform (In Excel 2016) lets you perform a series of steps to transform... read more

Download Excel Workbook
Bryan
Posted on

Overview

Process Flat Data Using Modulo in Power Query | MyExcelOnline

Power Query or Get & Transform (In Excel 2016) lets you perform a series of steps to transform your Excel data.  One of the steps it allows you to take is to process flat data via the Modulo calculation in Power Query.

This is a really cool trick that you have to see! In our table, we have this flat sales data, and we want to extract just the names:

Process Flat Data Using Modulo in Power Query

Imagine doing it by hand, it is going to take forever! But with Power Query, it will be done in a flash!

Process Flat Data Using Modulo in Power Query | MyExcelOnline

Download excel workbookProcess-Flat-Data-using-Modulo.xlsx

STEP 1: Select your data and go to Data > Get & Transform > From Table (Excel 2016) or Power Query > Excel Data > From Table (Excel 2013 & 2010)

Excel 2016:

 Keep Duplicates Using Power Query or Get & Transform

Excel 2013 & 2010:

Keep Duplicates Using Power Query or Get & Transform

 

STEP 2: This will open up the Power Query Editor.

Notice that our flat sales data has a pattern. The pattern “Region, Salesperson Name, Sales” repeats every 3 rows!

Let as add an Index Column to number all of the rows. Go to Add Column > General > Index Column

Process Flat Data Using Modulo in Power Query

 

STEP 3: This is where the magic happens!

Make sure the Index column is selected. Go to Add Column > Number Column > Standard > Modulo

Process Flat Data Using Modulo in Power Query

Since our pattern repeats every 3 rows, let us type in 3. Click OK.

Process Flat Data Using Modulo in Power Query

Now we have our modulo results.

Process Flat Data Using Modulo in Power Query

STEP 4: Notice that the Salesperson name consistently matches the Modulo value 1? We can now extract the names quickly!

Click on the Filter icon of the Modulo column and make sure only 1 is ticked. This will hide the other unnecessary rows.

Process Flat Data Using Modulo in Power Query

 

 

STEP 5: Click Close & Load from the Home tab and this will open up a brand new worksheet in your Excel workbook with the updated records!

 

Process Flat Data Using Modulo in Power Query

You now have the names thanks to Modulo in Power Query!

Process Flat Data Using Modulo in Power Query

 

How to Process Flat Data Using Modulo in Excel Using Power Query

 

Free Excel Macros & VBA Webinar Training

 

If you like this Excel tip, please share itEmail this to someone

email

Pin on Pinterest

Pinterest

Share on Facebook

Facebook

Tweet about this on Twitter

Twitter

Share on LinkedIn

Linkedin

Process Flat Data Using Modulo in Power Query | MyExcelOnline
Process Flat Data Using Modulo in Power Query | MyExcelOnline
Bryan

Bryan is a best-selling book author of the 101 Excel Series paperback books.

Get Video Training

Advance your Microsoft Excel & Office Skills with the MyExcelOnline Academy!

Dramatically Reduce Repetition, Stress, and Overtime!
Exponentially Increase Your Chances of a Promotion, Pay Raise or New Job!

Learn in as little as 5 minutes a day or on your schedule.

Learn More!