Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk4 min

How to Retrieve Values from Many Excel Workbooks

Learn how to combine Excel workbooks with Power Query, choose append or merge, and refresh the result when source files change.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To collect data from many Excel workbooks, use Power Query’s From Folder connector for files stored locally, or the SharePoint Folder connector for work or school files in SharePoint or OneDrive. Combine the intended files, then choose whether to append their rows into one table or merge tables to retrieve fields for matching keys. A saved query can be refreshed when its source files change.

Choose between stacking records and looking up matches

First decide what the finished result should contain. Power Query’s folder connector gathers data from multiple files; append and merge determine how tables relate in the result.

As an Amazon Associate I earn from qualifying purchases.

Your goal Operation What it does
Put records from similarly structured workbooks into one longer table Append Adds rows from one query after another. Columns align by their names, so a missing column can result in null values.
Find rows with the same key and bring selected fields across Merge Matches tables on a common column value; expand the columns you want from the matching table.

For example, if every monthly workbook contains the same kind of transaction records and you want them all in one list, combine the files and append the rows. If one table has employee IDs and you want to bring in each matching employee’s department from another table, merge on the ID and expand the department field.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Prepare the workbooks before combining them

Folder combine works best when files have a consistent structure: the same column headers, data types and number of columns. Column order can differ because Power Query matches columns by name. Each workbook may contain multiple sheets, tables or named ranges, so confirm that the selected object is the one you intend to extract.

#1 Best Overall
Sale
The Microsoft Office 365 Bible: The Most Updated and Complete Guide to Excel, Word, PowerPoint, Outlook, OneNote, OneDrive, Teams, Access, and Publisher from Beginners to Advanced
  • The Microsoft Office 365 Bible: The Most Updated and Complete Guide to Excel, Word, PowerPoint, Outlook, OneNote, OneDrive, Teams, Access, and Publisher from Beginners to Advanced
  • ABIS BOOK
  • Put only the intended source workbooks in a dedicated folder, or carefully filter the file list before combining.
  • Check that the files use consistent headers and compatible data types.
  • Decide which sheet, table or named range should be extracted from each workbook.
  • If layouts or workbook objects vary, inspect and standardize the sources before depending on one combined result.

Power Query uses a sample file to establish the extraction steps and applies those steps to the other files. An unrelated workbook in the folder, or a change to the source structure, can therefore affect the combined output. Microsoft explains the sample-file process and schema expectations in its combine-files overview.

Combine files from a local folder

  1. Place the source workbooks in a folder reserved for this query.
  2. In Excel, select Data > Get Data > From File > From Folder.
  3. Review the listed files. Filter by extension or folder path if needed so only the intended files are included.
  4. Choose the combine option and use the sample-file and navigation experience to select the sheet, table or other workbook object to extract.
  5. In Power Query, check the preview, make any needed transformations, and load the result.

Microsoft’s Folder connector documentation describes the connector and its combine workflow. Once the files are combined, append or merge as appropriate for the result you chose.

Combine SharePoint or OneDrive work files

For files in SharePoint or OneDrive for work or school, use the SharePoint Folder connector to access the target location and combine the relevant files. Check the contents and filter to the intended folder and files before combining. If you need only one workbook, select that file’s binary value to navigate into it rather than combining the folder. Microsoft notes that SharePoint.Contents can be optimal in environments with a large number of files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

See Microsoft’s SharePoint Folder connector guidance for connection and navigation details.

Retrieve data from just one workbook

If you are importing from a single file rather than many, use Data > Get Data > From File > From Excel Workbook, browse to the workbook and select the intended object in Navigator. Load it directly or choose to transform it in Power Query first. For multiple workbooks, Microsoft recommends a multi-file connector such as Folder or SharePoint Folder; see its Excel workbook connector documentation.

Refresh the combined result

Power Query stores the transformation steps and runs them again when you refresh, bringing in changes, additions and deletions from external sources. Refresh after source files change, and review the result if a file or workbook structure has changed: the folder-combine process applies the sample-file extraction steps to each file. Microsoft describes the refresh behavior in its Power Query refresh documentation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Check platform and file-format requirements

Power Query is available in Excel for Windows, Mac and the web, but capabilities can vary by host and deployment. Menu labels and behavior may also differ by version. Consult Microsoft’s Power Query overview for platform details and confirm the steps in the Excel environment you use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Legacy .xls and .xlsb workbooks can require the Access Database Engine OLEDB provider. Microsoft says that provider cannot be installed in cloud service environments; a gateway with ACE may be needed there. Check the current Excel connector requirements if those formats or cloud-hosted processing apply to your workflow.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.