Updated August 11, 2023
Import Data In Excel
Microsoft has provided some functions that can be used to import data from different sources and connect them with Excel. We can import the data from different sources such as Access, Web, Text, SQL Server, or any other database. We can connect Microsoft Excel with many sources and import the data in many ways.
How To Import Data In Excel?
Let’s see how to import data in Excel by using some examples:
Import Data In Excel – Example #1
We often faced a situation where we needed to extract or import the data from other sources. And in Excel, we can use the function Get External Data to import the required fields to work from different sources.
We can extract the data in Excel by going into the Data menu tab, under getting and Transform data, select any required source as shown below.
Those options are shown in the below screenshot.
There are many different ways to import data in Excel.
- From Text/CSV: Text files whose data can be separated with tab or Excel columns.
- From Table/Range: Create a new query linked to the selected Excel table or named range.
- From Web: Any website whose data can be converted to Excel tables.
Above mentioned ways of importing the data are majorly used. There are some other ways also, as shown in the below screenshot. For that, click on From SQL Server Database under From Database section. Once we do that, we will get a drop-down list of all the other sources from where we can import the data.
Once we import the data from any server or database, the connection gets established permanently till we remove it manually. And in the future, we can import the data from previously established and connected sources to save time. For this, go to the Data menu tab; under Get & Transform Data, select Existing Connections, as shown below.
Once we click on it, we will get a list of all existing connections we link with our computer, excel, or network, as shown below. Select the required connection point from that list and click Open to access that database.
Now let’s import some data from any website. We must have the link to the website from where we need to import the data. For example, we have considered the link to Wikipedia as given below.
Now, go to the Data menu; under Get & Transform Data section, select From Web as shown below.
Once we do that, we will get a Web Query box. There at the address tab, copy and paste the link and click on Go, as shown below.
It will then take us to the web page of that link, as shown below. Now click on the Import button to import the data.
The Import Data box will appear, asking for a reference cell or sheet to import the data. Here we have select cell A1 as shown below. And click on OK.
Then the query will run and fetch the data from the provided link, as shown below.
Import Data In Excel – Example #2
Let’s see another way of importing the data. For this, we have some sample data in Notepad (or Text) file, as shown below. As we can see, the data has spaces between the lines like columns in Excel has.
Importing such data is easy as it is already separated with spaces. Now to import the data in the text file, go to the Data menu tab; under the Getting and Transform data section, select From Text option as shown below.
After that, we will get a box asking us to browse the file. Search and select the file and click the Import button to process further.
Select the Delimited option for a proper way to separate the data into columns, or select the Fixed Width option to do it manually. Just after that, a text import wizard will appear, which will ask us to delimit or separate the text. Here we have selected Delimited as shown below.
Here we have delimited the text with Tab as shown below. Now click on Next to complete the process.
Now select the way we want to import the data. Here we have selected cell A1 for the reference point and click on OK.
We will see our data imported to Excel from the selected file.
We can import the data from different sources or databases to Excel to work on them like this.
Pros of Importing Data in Excel
- By importing the data from other sources, we can link different tables, files, columns, or sections and get the required data.
- It saves time by manually copying and pasting the heavy data from one source to Excel.
- We also avoid unnecessary crashing or handing off files if the data is huge.
Cons of Importing Data in Excel
- Sometimes processing time is huge.
Things to Remember
- Ensure you are connected to a good internet connection when importing data from SQL Servers or similar databases.
- Do not do anything while data is imported from the source files or database. It may crash the opened files.
- Always protect the previously established connection with a password.
This has been a guide to Importing Data in Excel. Here we discussed how to import data in Excel, practical examples, and a downloadable Excel template. You can also go through our other suggested articles to learn more –