Pinterest Pixel

Process Flat Data Using Modulo in Power Query

Bryan
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.

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 it



Process Flat Data Using Modulo in Power Query | MyExcelOnline


Bryan

Bryan Hong is an IT Software Developer for more than 10 years and has the following certifications: Microsoft Certified Professional Developer (MCPD): Web Developer, Microsoft Certified Technology Specialist (MCTS): Windows Applications, Microsoft Certified Systems Engineer (MCSE) and Microsoft Certified Systems Administrator (MCSA).

He is also an Amazon #1 bestselling author of 4 Microsoft Excel books and a teacher of Microsoft Excel & Office at the MyExecelOnline Academy Online Course.

See also  Top 3 Methods on How to Merge Excel Files - A Step-by-Step Guide

Star 30 Days - Full Access Star

One Dollar Trial

$1 Trial for 30 days!

Access for $1

Cancel Anytime

One Dollar Trial
  • Get FULL ACCESS to all our Excel & Office courses, bonuses, and support for just USD $1 today! Enjoy 30 days of learning and expert help.
  • You can CANCEL ANYTIME — no strings attached! Even if it’s on day 29, you won’t be charged again.
  • You'll get to keep all our downloadable Excel E-Books, Workbooks, Templates, and Cheat Sheets - yours to enjoy FOREVER!
  • Practice Workbooks
  • Certificates of Completion
  • 5 Amazing Bonuses
Satisfaction Guaranteed
Accepted paymend methods
Secure checkout

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!

Share to...