Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Excel Power Query: Get Data From a Table Range

· 6 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To pull data from an Excel table or range into Power Query, click any cell inside the table, go to the Data tab, and choose From Table/Range in the Get & Transform Data group. Power Query opens a preview window showing your data, and you then either load it back to a worksheet or close and load it into the Data Model. The one requirement is that your source be a properly formatted Excel Table (created with Ctrl+T) rather than a loose block of cells, because Power Query handles tables far more reliably than plain ranges.

This matters because Power Query records every cleanup step you take as a repeatable query. When new rows are added to the source table, you refresh the query and the output updates automatically, instead of re-copying and re-pasting by hand. Menu labels can differ slightly by Excel version, platform and region, so if a button name looks different on your machine, look for the closest match.

What You'll Need

  • Excel for Windows, Excel for Mac, or Excel for the web with Power Query available (it is built into modern Excel versions; older releases may need the Power Query add-in).
  • A worksheet containing your data, ideally converted to a Table with a single header row and no merged cells.
  • No blank rows or blank columns inside the data block, and no totals rows mixed in with the records.
  • Write access to the workbook if you intend to save the query with it.

Step-by-Step

  1. Clean the source layout first. Put one header in each column, one record per row, and remove merged cells, subtotal rows and entirely blank rows or columns. Power Query reads a messy block as messy data, and fixing it afterward is harder than fixing it now.
  2. Convert the range to a Table. Select any cell in the data and press Ctrl+T (Cmd+T on Mac). Confirm the range in the Create Table dialog and make sure My table has headers is ticked if row one contains your column names. Give the table a meaningful name in the Table Design tab so you can identify it later.
  3. Click inside the table. Any single cell within the table is enough; you do not need to select the whole thing.
  4. Open the Data tab and choose From Table/Range. In Excel for Windows and Mac this sits in the Get & Transform Data group. In Excel for the web the same command is available from the Data tab. If the button is greyed out, you are probably not inside a table or the workbook is in a protected view.
  5. Check the preview. The Power Query Editor opens with your table loaded as a query. Confirm the column headers are correct, that the data types shown in the header icons make sense (text, whole number, date, and so on), and that no columns appear as errors.
  6. Apply any transformations you need. Use the ribbon to remove columns, filter rows, split columns, change data types or rename headers. Each action is recorded in the Applied Steps list on the right, and you can click any step to review or delete it.
  7. Choose how to output the result. Click Close & Load to send the result to a new worksheet as a table, or use the dropdown on that button and pick Close & Load To to load it to an existing worksheet, to the Data Model only, or as a connection only.
  8. Refresh when the source changes. Right-click the output table and choose Refresh, or use Data > Refresh All. The query re-reads the source table and reapplies every step.

Common Mistakes

Leaving the data as a plain range. Power Query can read a range, but a Table is more robust: it expands automatically as rows are added, so the query keeps seeing new records instead of a fixed address block.

Blank rows and columns inside the data. These get imported as null records or empty columns and break sorting, filtering and any merge with another query. Delete them before loading.

Wrong data types. A date stored as text, or a number with a stray space, will not sort or calculate correctly. Set the type explicitly in the editor rather than relying on the automatic detection.

Merged header cells. Power Query promotes the first row to headers, so merged cells produce blank or duplicated column names. Unmerge and repeat the header in each column.

Editing the output table by hand. Typing into the loaded table breaks the connection to the query; the next refresh overwrites your edits. Do all changes in the query, or in a separate column outside the loaded table.

Forgetting to refresh. The loaded table is a snapshot until you refresh it. If numbers look stale, refresh before assuming the query is wrong.

Tips

Name your queries descriptively in the Queries pane so a workbook with several sources stays readable. Keep the source table on its own sheet and avoid placing notes or totals directly beneath it, since those can be picked up as data. Use the first row as headers option deliberately, and rename columns in the editor rather than in the worksheet so the names survive a refresh. If you only need the data for a PivotTable, load it to the Data Model instead of a worksheet to keep the file smaller. Finally, save the workbook before a large refresh so you can close without saving if something goes wrong.

Troubleshooting

The From Table/Range button is greyed out. Click inside the table first, and check the workbook is not open in Protected View or read-only mode. If it is, enable editing and try again.

The query loads the wrong columns. Open the query in the editor and inspect the Source step. If the table was resized or a column was inserted, the step may be pointing at an outdated shape; correct the source step or rebuild the query from the table.

Refresh fails with a data source error. Confirm the source table still exists and has not been renamed or deleted, and that the workbook is saved in a location Excel can still reach. If the file was moved, update the source path in the query settings.

Numbers or dates come in as text. Select the column, use the data type dropdown in the header, and choose the correct type. If errors appear, look for stray characters or non-breaking spaces and clean them with a replace step.

Duplicate or missing rows. Check the Applied Steps for an accidental filter or remove-duplicates step, and delete it if it was not intended. Steps run in order, so a filter placed early can hide rows added later.

If that did not work, start a fresh query from the table and rebuild the steps one at a time, testing the preview after each. This isolates which step is causing the problem far faster than guessing.

Frequently Asked Questions

Can I use a plain range instead of a table?

Yes, the command accepts a range, but a table is recommended because it expands as you add rows and keeps the query pointed at the right data.

Does the original data get changed?

No. Power Query reads the source and writes results to a separate output; the source table stays as it is unless you edit it yourself.

What happens if I add rows to the source table?

The table expands to include them, and a refresh pulls the new rows into the query output.

Can I load the result into the Data Model?

Yes. Use Close & Load To and choose the Data Model option, which is useful when the output feeds a PivotTable.

Why does my loaded table not update automatically?

Queries refresh on demand by default. Use Refresh All, or set the query to refresh when the workbook opens in the query properties.

Can I share the workbook and keep the query working?

Yes, provided the recipient has access to the same source data and a compatible Excel version; otherwise the refresh may fail on their machine.