Wednesday, May 13, 2020

How do you query data in a MS Excel Worksheet?


Excel has a tool called Power Query which can be used to query data from many data sources, external data sources, or a source in an Excel worksheet, such as a table.

Here are the types of external data you can query using Excel.
Power Query Data Sources

Web page

Excel or CSV file

XML file

Text file

Folder

SQL Server database

Microsoft Azure SQL Database

Access database

Oracle database

IBM DB2 database

MySQL database

PostgreSQL Database

Sybase Database

Teradata Database

SharePoint List

OData feed

Microsoft Azure Marketplace

Hadoop File (HDFS)

Microsoft Azure HDInsight

Microsoft Azure Table Storage

Active Directory

Microsoft Exchange

Facebook

In the present post, you can see how you can query data in a worksheet, using Power query.

The following three steps show how you may do it.



 In the above worksheet, I created a table. Inserted three rows of data and highlighted them. Then I clicked, Insert and, picked up Create Table from the drop-down. This gave me the second dialog Create Table pre-filled with my data. I then clicked OK to create a table as shown in the bottom of the above.


Now I clicked Data and Query and Connections. I then clicked the option From/Table Range to Open the Power Query Editor. 


Now it is straight forward to query the Table in Excel worksheet.

More on Power Query here:

https://support.office.com/en-us/article/introduction-to-microsoft-power-query-for-excel-6e92e2f4-2079-4e1f-bad5-89f6269cd605

No comments: