Popular Searches
Popular Course Categories
Popular Courses

Connecting to Supported External Data Sources

Connecting to Supported External Data Sources

Power Query in Excel

Connecting to Supported External Data Sources in Excel

Course: Advanced Excel

Topic: Connecting to Supported External Data Sources

Course Link: Advanced Excel Course

Demo Link: Register for a Course Demo

Website: JustAcademy


1. Introduction to External Data Sources

Microsoft Excel is not limited to analyzing information entered manually into worksheets. It can also connect to external data sources such as CSV files, text files, other Excel workbooks, databases, websites, SharePoint, and selected cloud services. These connections allow users to bring information into Excel for cleaning, calculation, reporting, visualization, and business analysis.

In organizations, data is often distributed across different systems. Sales information may be stored in a database, employee details in an Excel workbook, inventory data in CSV files, and customer information in an online application. Connecting Excel to these sources helps analysts combine information and create reports without repeatedly copying and pasting data manually.

Excel's Power Query feature, also known as Get & Transform Data, is one of the primary tools for connecting to, importing, transforming, and combining data from supported sources. Available connectors depend on the Excel version, operating system, licensing, installed drivers, and authentication requirements. Microsoft's Power Query data source documentation provides version-specific information.

2. Learning Objectives

  • Understand external data sources and Excel data connections.
  • Identify commonly supported data source types.
  • Connect to Excel workbooks, CSV files, text files, databases, and web sources.
  • Use Power Query to preview and transform imported data.
  • Load data into worksheets or the Excel Data Model.
  • Refresh connections when the source data changes.
  • Manage credentials, permissions, and connection properties.
  • Troubleshoot common connection and refresh errors.
  • Apply best practices for reliable and secure data integration.

3. What Is an External Data Source?

An external data source is a location or system outside the current workbook from which Excel retrieves information. It may be a local file, a shared folder, an online service, or a database hosted on a local server or in the cloud.

Examples of External Data Sources

Data Source Example Typical Business Use
Excel workbook Monthly sales.xlsx Combining departmental reports
CSV file orders.csv Importing sales or transaction records
Text file inventory.txt Processing exported system data
SQL database SQL Server database Retrieving customer or sales records
Access database company_data.accdb Analyzing structured business records
Web source Public web table or supported API Importing published or service-provided information
SharePoint SharePoint document library Working with shared organizational data
Folder Monthly CSV reports folder Combining multiple files with a consistent structure
OData feed Supported OData service Retrieving structured service data
Other databases Oracle, PostgreSQL, MySQL, or other supported systems Enterprise reporting and data analysis

Important: Not every connector is available in every Excel edition. Some database connectors require additional drivers, enterprise licenses, or permissions. Confirm compatibility with your installed Excel version before planning a connection.

4. Understanding Excel Data Connections

A data connection contains information Excel needs to locate and access a source. Depending on the source, this may include a file path, server name, database name, query, authentication method, and connection settings.

Key Connection Components

  • Source location: Identifies the file, server, URL, or service.
  • Authentication: Establishes the user's permission to access the source.
  • Query: Defines which data to retrieve and how to transform it.
  • Destination: Specifies whether results load to a worksheet, the Data Model, or another supported destination.
  • Refresh settings: Determine when and how Excel retrieves updated information.
  • Connection properties: Store settings that control how the connection operates.

External data connections can reduce manual work and improve repeatability. However, a connection does not automatically guarantee that the workbook always contains the latest information. Data may need to be refreshed, and access permissions or source availability may affect the result.

5. Introduction to Power Query

Power Query is Excel's data connection and transformation technology. It enables users to import data from supported sources and perform repeatable steps such as removing unwanted columns, filtering records, changing data types, splitting fields, combining tables, and removing duplicates.

Instead of repeating the same cleanup process each month, you can save the transformation steps in a query and refresh the query when new data becomes available.

Main Features of Power Query

  • Connects to many supported file, database, web, and cloud sources.
  • Provides a preview of the source data before loading it.
  • Supports filtering, sorting, and column transformations.
  • Combines data from multiple files or tables.
  • Records transformation steps for reuse.
  • Allows queries to be loaded to a worksheet or Data Model, where supported.
  • Supports refreshing query results when source data changes.

Learn more in the Power Query for Excel Help documentation.

6. Accessing External Data Connections in Excel

In most modern desktop versions of Excel, the main entry point for importing data is the Data tab.

General Steps

  1. Open the Excel workbook where you want to use the imported data.
  2. Select the Data tab on the ribbon.
  3. Locate the Get Data or Get & Transform Data group.
  4. Select the relevant source category, such as From File, From Database, From Web, or From Other Sources.
  5. Choose the source file, server, or URL.
  6. Enter the required connection details and credentials, if prompted.
  7. Preview the available tables, files, or data.
  8. Select the data you want to use.
  9. Choose Transform Data to clean or shape it, or select a load option if the data is ready.
  10. Load the result to the appropriate destination.

Menu names and available connectors vary by version. If a connector is missing, check the version-specific documentation and your organization's Excel configuration.

7. Connecting to Another Excel Workbook

Excel can import data from another workbook. This is useful when different departments maintain separate files and a central workbook needs to consolidate their information.

Example Scenario

A business stores January sales in JanuarySales.xlsx and February sales in FebruarySales.xlsx. An analyst can connect to the files, standardize the column names, and combine the records into a consolidated report.

Steps

  1. Open the destination workbook.
  2. Select Data > Get Data > From File > From Excel Workbook, where available.
  3. Browse to the source workbook and select it.
  4. Review the available sheets, tables, and named ranges in the Navigator window.
  5. Select the required table or worksheet.
  6. Choose Transform Data if you need to clean the data.
  7. Check column names, data types, and blank rows.
  8. Load the cleaned result into the destination workbook.

Best Practices

  • Convert source data into a properly structured Excel Table where possible.
  • Use clear, consistent column headings.
  • Avoid merged cells and decorative headings inside the source data range.
  • Keep the source file in a stable location.
  • Verify that users who refresh the query have access to the source workbook.

8. Connecting to CSV and Text Files

CSV stands for Comma-Separated Values. It stores tabular data as text, usually with each record on a separate line and fields separated by commas. Text files may use tabs, semicolons, pipes, or other delimiters.

Typical CSV Data

OrderID,Customer,Region,Sales
1001,Aarav,West,12500
1002,Meera,North,9800
1003,Rohan,South,14300

Steps to Import a CSV File

  1. Select Data > Get Data > From File > From Text/CSV.
  2. Choose the CSV file.
  3. Review the preview and check the delimiter.
  4. Verify the file origin or encoding if non-English characters appear incorrectly.
  5. Choose Transform Data to inspect and clean the records.
  6. Set appropriate data types for IDs, dates, text, and amounts.
  7. Remove unnecessary rows or columns if required.
  8. Load the results to Excel.

Important CSV Considerations

  • Leading zeros in product codes or postal codes may disappear if Excel interprets them as numbers.
  • Dates may be interpreted differently depending on regional settings.
  • Numbers containing commas or decimal separators may require the correct locale.
  • Text containing delimiter characters must be properly quoted in the source file.
  • Large CSV files may be better handled through Power Query or the Data Model than loaded directly into a worksheet.

9. Connecting to a Folder of Files

The Folder connector is useful when many files have the same structure. Rather than importing every file separately, Power Query can combine files from a folder and apply common transformation steps.

Example Scenario

A company receives daily sales reports named Sales_01.csv, Sales_02.csv, and Sales_03.csv. The analyst wants one consolidated dataset for monthly reporting.

Steps

  1. Store the relevant files in a dedicated folder.
  2. Check that the files use compatible column names and formats.
  3. In Excel, select Data > Get Data > From File > From Folder, where available.
  4. Select the folder path.
  5. Review the file list.
  6. Choose the combine option and select an appropriate sample file or table when prompted.
  7. Inspect the generated query and transformation steps.
  8. Confirm that file names, headers, and data types are handled correctly.
  9. Load the consolidated results.

Benefits

  • Reduces repetitive importing.
  • Applies consistent transformation steps across files.
  • Makes monthly and weekly reporting more repeatable.
  • Can include new files during refresh when they meet the query's criteria.

Common Issues

If a new file has different column names, an unexpected worksheet name, or a different file format, the combine process may fail or produce incomplete results. Keep source files consistent and validate the consolidated row count after refreshing.

10. Connecting to Databases

Databases store structured information in tables, views, or other database objects. Excel can connect to supported databases to retrieve selected records for analysis. Depending on the database and Excel version, available connectors may include SQL Server, Access, Oracle, PostgreSQL, MySQL, IBM Db2, and other systems.

Example: Connecting to SQL Server

  1. Open Excel and select the Data tab.
  2. Choose Get Data > From Database > From SQL Server Database, where available.
  3. Enter the server name and database name if required.
  4. Select the appropriate authentication method.
  5. Choose a database table or view from the Navigator.
  6. Preview the data and select Transform Data if necessary.
  7. Filter columns and records to retrieve only the information needed.
  8. Load the results into a worksheet or Data Model, depending on the analysis requirements.

Database Connection Details

Detail Meaning
Server name Identifies the database server.
Database name Identifies the database to access.
Authentication Specifies how access is verified.
Table or view Identifies the object containing the data.
Query Defines which records and fields to retrieve, when supported.
Driver or provider Software required by certain connectors to communicate with the database.

Database Best Practices

  • Request only the columns and records required for the report.
  • Use read-only access when write access is unnecessary.
  • Follow organizational rules for credentials and permissions.
  • Coordinate with the database administrator for production systems.
  • Avoid placing passwords directly in worksheet cells or query text.
  • Validate the result against a trusted database report.

11. Connecting to Web Data

Excel's web connector can retrieve data from supported web pages and endpoints. The available result depends on the website's structure, access permissions, authentication requirements, and connector compatibility.

Steps to Connect to a Web Source

  1. Open Excel and select Data > Get Data > From Other Sources > From Web, or the equivalent option in your version.
  2. Enter the source URL.
  3. Choose the authentication method if prompted.
  4. Review the Navigator results, which may list tables or available data elements.
  5. Select the required table or result.
  6. Choose Transform Data to inspect the data.
  7. Confirm that the values, headers, and data types are correct.
  8. Load the results into Excel.

Important Web Connection Considerations

  • Not every webpage exposes data in a format that Excel can reliably import.
  • Pages that rely heavily on JavaScript may not expose their content as a simple HTML table.
  • Websites may require sign-in, API credentials, or permission to retrieve information.
  • Website structures can change, which may break a query.
  • Automated access should comply with the website's terms, permissions, and applicable policies.

When a service offers a documented API or structured feed, that option may be more reliable than extracting information from a webpage's visual layout.

12. Connecting to SharePoint and Cloud-Based Sources

Organizations frequently store shared files and structured data in Microsoft 365 services. Depending on the Excel version and account, Power Query may support SharePoint folders, SharePoint lists, and files stored in organizational SharePoint or OneDrive locations.

Common Uses

  • Importing shared Excel reports.
  • Combining CSV files from a team document library.
  • Retrieving records from a supported SharePoint list.
  • Building reports from centrally maintained business files.

General Connection Process

  1. Confirm that you have permission to access the source.
  2. Select the relevant SharePoint or cloud connector from the Data tab.
  3. Enter the site URL or required source information.
  4. Authenticate using the appropriate organizational account.
  5. Select the required files, folders, or list.
  6. Filter the results to include only the relevant data.
  7. Transform and load the result.
  8. Test refresh access using the account and environment where the workbook will be used.

Do not assume that a connection which works on one computer will automatically refresh for every colleague. Each user or refresh environment may need suitable permissions and authentication.

13. Understanding Data Types During Import

Data types define how Excel and Power Query interpret values. Correct data types are essential for calculations, filtering, sorting, date analysis, and reporting.

Data Type Example Purpose
Text Customer name Names, categories, codes, and identifiers
Whole number Quantity: 25 Counts and whole-number measurements
Decimal number Price: 149.75 Measurements and values with decimals
Date 2026-10-27 Date-based analysis and grouping
Date/Time 2026-10-27 14:30 Timestamp analysis
True/False Active: True Logical conditions
Currency or fixed decimal Revenue: 12500.50 Financial values where appropriate

Changing Data Types in Power Query

  1. Open the query in Power Query Editor.
  2. Select the relevant column.
  3. Open the data type selector in the column header or Transform tab.
  4. Choose the correct type.
  5. Review any conversion errors.
  6. Resolve invalid values before loading the data.

Identifiers such as employee IDs, product codes, and postal codes should often be stored as text, even if they contain only digits. This preserves leading zeros and prevents Excel from treating an identifier as a quantity.

14. Transforming Data Before Loading

Data from external sources may contain unnecessary columns, blank records, inconsistent text, duplicate rows, or values stored in the wrong format. Power Query can apply repeatable cleanup steps before the data reaches the worksheet.

Common Transformations

  • Remove unnecessary columns.
  • Filter rows by date, region, category, or status.
  • Remove duplicate records where appropriate.
  • Promote the first row to column headers.
  • Rename columns to consistent names.
  • Split a combined field into multiple columns.
  • Merge or append tables.
  • Replace invalid or inconsistent values.
  • Change data types.
  • Group records and calculate summaries.

Example: Cleaning Sales Data

Suppose a CSV file contains sales records with a blank customer field and an unnecessary notes column. In Power Query, you can remove the notes column, filter records where the customer field is blank, standardize the region names, and set the sales column to a numeric type before loading the data.

Each transformation is recorded as a query step. On refresh, Power Query attempts to apply those steps to the newly retrieved source data.

15. Loading Imported Data into Excel

After connecting and transforming data, choose where the result should be loaded. The correct destination depends on the size of the dataset and how it will be analyzed.

Load to a Worksheet

Choose a worksheet table when users need to inspect the records directly, apply worksheet formulas, or use the data in standard Excel charts.

Load to the Data Model

Load to the Data Model when you need to work with larger related datasets or build PivotTables using relationships between tables. Availability and functionality depend on the Excel version and platform.

Create a Connection Only

Where available, a connection-only query keeps the query available for reuse without placing its complete result in a worksheet. This is useful for staging queries that feed other queries or the Data Model.

Load Option Best Use
Worksheet table Direct review and ordinary worksheet analysis
Data Model Related tables and model-based reporting
Connection only Reusable staging or intermediate queries

16. Refreshing External Data

Refreshing retrieves updated information from a source and applies the query or connection again. This helps keep reports aligned with the latest source data, provided the source is available and the user has permission to access it.

Manual Refresh

  1. Open the workbook.
  2. Select a cell in the imported table or locate the query in Queries & Connections.
  3. Choose Refresh or Refresh All from the Data tab.
  4. Wait for the refresh to complete.
  5. Check for errors and verify that the row counts and latest values are correct.

Configure Refresh Properties

Depending on the connection type, Excel may offer settings for refreshing when the workbook opens or refreshing at defined intervals. These settings are not available or supported in exactly the same way for every connector and platform.

See Microsoft's overview of data connections and refresh behavior for further details.

17. Managing Queries and Connections

The Queries & Connections pane helps users inspect queries, refresh results, edit transformation steps, and manage connection properties.

Typical Management Tasks

  • Rename a query to make its purpose clear.
  • Edit source paths or connection settings when a source moves.
  • Refresh a query to retrieve updated records.
  • Review transformation steps when the output changes unexpectedly.
  • Inspect connection properties and authentication requirements.
  • Remove obsolete queries and connections after confirming they are no longer needed.

Recommended Query Naming Convention

Query Name Purpose
qry_Sales_Source Imports the original sales data
qry_Sales_Clean Applies cleanup and data type changes
qry_Sales_Combined Combines sales records from multiple files
qry_Sales_Summary Produces summarized data for reporting

Consistent names make workbooks easier to maintain, especially when multiple queries depend on one another.

18. Authentication, Privacy, and Data Security

External data sources may contain confidential or business-critical information. A connection should be configured with appropriate authentication, permissions, and privacy settings.

Authentication Methods

  • Anonymous: Used for sources that permit access without user credentials.
  • Windows authentication: Uses supported Windows or organizational credentials for certain connections.
  • Organizational account: Commonly used for Microsoft 365 and supported enterprise services.
  • Database credentials: Uses a supported database authentication method.
  • API credentials or tokens: Required by some web services and APIs.

Exact methods depend on the connector and service. Never store sensitive passwords in worksheet cells or distribute credentials in plain text.

Security Best Practices

  • Use approved sources and authorized accounts.
  • Grant only the permissions needed for the analysis.
  • Follow company policies for confidential and personal data.
  • Do not share workbooks containing embedded sensitive connection details.
  • Review Power Query data source settings and privacy levels when combining sources.
  • Use trusted storage locations for shared workbooks and connection files.
  • Test access before distributing a workbook to colleagues.

19. Common Connection Errors and Solutions

Error Possible Cause Suggested Solution
File not found The source file was moved or renamed. Update the source path and test the connection.
Access denied The account lacks permission. Request authorized access and sign in with the correct account.
Invalid credentials Saved authentication is expired or incorrect. Review data source settings and authenticate again.
Database connection failed Server, database, network, or driver problem. Check server details, network access, database availability, and required drivers.
Column not found The source schema changed. Review transformation steps and update column references.
Data type conversion error Some values do not match the selected type. Inspect invalid records and correct or handle them before conversion.
Web import failed The URL, authentication, or website structure changed. Verify the URL and permissions, then inspect the source using the connector preview.
Refresh is slow Large source, inefficient query, or network latency. Filter early, select fewer columns, and ask the data owner about query performance.
New files are missing Files do not meet folder query filters or structure requirements. Review folder path, file extensions, sample-file logic, and filters.

20. Performance Optimization for External Connections

Large or complex data sources can make refreshes slow and workbooks difficult to maintain. Good query design can improve performance.

  • Retrieve only the columns required for the report.
  • Filter out irrelevant records as early as practical.
  • Avoid loading intermediate queries to worksheets when they are needed only for other queries.
  • Use source-side filtering or database views when appropriate and authorized.
  • Keep transformations clear and remove unnecessary steps.
  • Choose the Data Model for suitable larger relational datasets instead of loading every record into a worksheet.
  • Use consistent source schemas when combining files.
  • Test refresh performance with realistic data volumes.

Some Power Query operations can be pushed back to supported data sources through query folding. Whether this happens depends on the connector and transformations. It should not be assumed that every step executes at the source.

21. Practical Example: Consolidating Monthly Sales Data

Scenario: A retail company stores monthly sales in separate CSV files. Each file contains Order ID, Order Date, Region, Product, Quantity, and Sales Amount. Management wants one consolidated report that can be refreshed every month.

Procedure

  1. Create a dedicated folder for monthly sales CSV files.
  2. Verify that every file has the same column names and compatible formats.
  3. Connect to the folder using Power Query.
  4. Combine the files and inspect the resulting dataset.
  5. Set Order Date to a date type, Quantity to a numeric type, and Sales Amount to a numeric or suitable currency type.
  6. Remove blank rows and investigate invalid sales values.
  7. Confirm that Order ID is treated consistently and duplicate orders are handled according to business rules.
  8. Load the combined query into an Excel table or the Data Model.
  9. Create a PivotTable summarizing sales by month and region.
  10. Add a chart to visualize sales performance.
  11. Place new compatible monthly files in the folder and refresh the query.
  12. Verify the latest data and the total sales against the source reports.

Expected Result

The workbook becomes a repeatable reporting solution. Instead of importing and cleaning each month's file manually, the analyst can reuse the saved query steps and refresh the consolidated dataset when new files are added.

22. Hands-On Practice Exercise

Objective: Connect Excel to an external CSV file, transform the data, and produce a simple report.

Sample Data

OrderID,OrderDate,Region,Product,Quantity,SalesAmount
2001,2026-01-05,West,Laptop,2,90000
2002,2026-01-07,North,Mouse,5,2500
2003,2026-01-09,South,Keyboard,3,4500
2004,2026-01-12,West,Monitor,2,30000
2005,2026-01-15,East,Laptop,1,45000

Tasks

  1. Save the sample records as SalesData.csv.
  2. Import the CSV file using the Data tab.
  3. Inspect the data in Power Query Editor.
  4. Set OrderDate to Date, Quantity to Whole Number, and SalesAmount to an appropriate numeric type.
  5. Rename the query to qry_SalesData.
  6. Load the query into an Excel worksheet.
  7. Create a PivotTable showing total sales by region.
  8. Create a chart using the PivotTable results.
  9. Change a value in the source CSV file and refresh the query.
  10. Confirm that the updated result appears in the report.

Practice Questions

  • Which steps were performed in Power Query?
  • Why is it important to assign correct data types?
  • What happens if the CSV file is moved to a different location?
  • How would you combine several monthly files with the same structure?
  • What checks would you perform after refreshing the query?

23. Mini Project: External Data Integration Dashboard

Create an Excel dashboard that integrates data from at least two supported sources, such as a CSV file and another Excel workbook. If you have access to an approved database or SharePoint source, you can use that instead.

Project Requirements

  • Import data from two sources.
  • Clean column names and data types.
  • Document the purpose of each query.
  • Combine or relate the datasets where appropriate.
  • Create a PivotTable or summary table.
  • Build a chart showing a useful business metric.
  • Test the refresh process.
  • Record any credentials, permissions, or source-location dependencies that a future user must know about, without recording passwords.
  • Write a short explanation of the source data and transformation steps.

Project Evaluation Checklist

  • Do both sources connect successfully?
  • Are column names and data types correct?
  • Are duplicate or missing records handled intentionally?
  • Does the report reconcile with the source data?
  • Can the workbook refresh after the source data changes?
  • Are permissions and data privacy handled appropriately?

24. Interview Questions and Answers

Q1. What is an external data source in Excel?

An external data source is a file, database, website, service, or other system outside the current workbook from which Excel retrieves data.

Q2. What is Power Query?

Power Query is Excel's data connection and transformation technology. It allows users to import, clean, combine, and prepare data through repeatable steps.

Q3. What is the difference between importing data and connecting to data?

Importing brings data into the workbook or model. A connection provides the source and retrieval details used to obtain data. In many Power Query workflows, the connection and query are saved so the results can be refreshed.

Q4. Which external sources can Excel connect to?

Depending on the Excel version and configuration, sources may include Excel workbooks, CSV and text files, folders, supported databases, web sources, SharePoint, OData feeds, and selected cloud services.

Q5. What is the purpose of the Navigator window?

The Navigator helps users browse and select available tables, worksheets, files, or other data objects exposed by a connector.

Q6. Why is Power Query useful for recurring reports?

It saves transformation steps so the same data-cleaning process can be reused when the source is refreshed.

Q7. What is the difference between a worksheet table and the Data Model?

A worksheet table displays records directly on a worksheet. The Data Model supports relationships between tables and model-based analysis, subject to the capabilities of the Excel version.

Q8. What does Refresh All do?

It attempts to refresh the workbook's relevant external data connections and queries. The result depends on source availability, permissions, connector support, and refresh settings.

Q9. Why might a query fail after a source file is renamed?

The saved query may still point to the old file path. Updating the source path and checking the query steps can resolve the problem.

Q10. Why should data types be checked after importing?

Incorrect data types can cause calculation errors, inaccurate sorting, failed date operations, and incorrect aggregations.

Q11. What is a folder connection used for?

It can retrieve and combine multiple files from a folder when their structure is compatible with the query's combine logic.

Q12. What should you do if a database connection fails?

Check the server and database details, network access, required driver, authentication method, permissions, and source availability.

Q13. How can external data connections be secured?

Use authorized accounts, least-privilege access, approved storage locations, and suitable authentication. Avoid exposing passwords or confidential data in workbooks.

Q14. Why might the same connection work for one user but fail for another?

Users may have different permissions, credentials, installed drivers, network access, or Excel configurations.

Q15. What is the benefit of combining data from multiple sources?

It allows related information from separate systems to be analyzed together, supporting more complete reporting and business decisions.

25. Quick Revision Checklist

  • Understand the meaning of external data sources and data connections.
  • Know where to find Get Data and Queries & Connections.
  • Connect to Excel workbooks, CSV files, folders, and supported databases.
  • Understand the basics of web and SharePoint connections.
  • Use Power Query to clean and transform imported data.
  • Assign appropriate data types.
  • Choose a suitable loading destination.
  • Refresh data and validate the updated results.
  • Manage connection properties and authentication.
  • Troubleshoot file paths, credentials, driver, and schema errors.
  • Apply security and performance best practices.

26. Conclusion

Connecting to supported external data sources is an essential Advanced Excel skill. It allows analysts to retrieve information from files, databases, websites, and organizational systems instead of relying entirely on manual data entry. Power Query makes these workflows more repeatable by combining connection, transformation, and refresh capabilities.

Reliable results depend on choosing the correct connector, validating the imported data, applying appropriate transformations, protecting credentials, and testing refresh behavior. When these practices are followed, Excel can become a practical reporting tool for consolidating data and producing useful business insights.

27. Additional Learning Resources

Previous Next
whatsapp