Locked lesson.
About this lesson
Sometimes you don't want to add a table style to your document. In this lesson we'll look at how to import data from an Excel range.
Exercise files
Download this lesson’s related exercise files. You can download source data files for the course from the resources section of your Lessons page.
Getting data from Excel ranges.xlsx19.4 KB Getting data from Excel ranges - Completed.xlsx
34.3 KB
Quick reference
Getting Data from Excel Ranges
An overview of importing data from a range of cells in an Excel worksheet.
When to use
When you do not want Power Query to format the data being used in the query into an official Excel table.
Instructions
Creating a named range
- Highlight the data you wish to pull into Power Query
- Type your desired Named Range in the name box next to Excel’s formula bar (no spaces)
Connecting Power Query to the named range
- Select the data by selecting the Named Range from the name box
- Create a new query --> From Table/Range
Advantages and disadvantages of named ranges vs tables
- Named Ranges do not automatically expand when new data is added whereas Tables do
- Tables apply formatting and force static column headers
- Named Ranges can be updated via the Name Manager on the Formulas tab in Excel
Connecting to dynamic named ranges
- Dynamic Names Ranges cannot be selected from the name list to be used in a query
- Create a new query --> From Other Sources --> Blank Query
- Enter the following formula in the formula bar: =Excel.CurrentWorkbook()
- Press Enter and a table of available tables and ranges is created
- Drill in by clicking the green “Table” text next to the Dynamic Named Range’s name
Hints & tips
- Since Excel tables must have fixed headers you will need to use a Named Range if you want to drive column headers with formulas
- Prefacing your range’s name with something like “rng”:
- Keeps the name from conflicting with logically named tables created by Power Query
- Makes it easier to find the “system” Named Ranges in the name box list
- If the formula bar is not present in the Query Editor, you can enable it from the View tab
- You cannot access a Dynamic Named Range from another workbook, from Power BI Desktop, or when using non-subscription versions of Excel 2016
Lesson notes are only available for subscribers.