Here's how to insert file names in Excel!
If a large number of files accumulate over a long period of time, it can quickly become confusing. We'll show you how to insert file names in Excel and work with them!
- Published
- Content reviewed
Listen to this article
Start reading aloud with a voice from your device. Changing the voice, speed or section stops playback; you can then start again.
Checking available voices.
Overview
Over time, a pile of files often accumulates. For example, in a company's accounting department, many invoices pile up over the course of a year, all of which end up in a single folder where it's easy to lose track of them.
Wouldn't it be great to be able to simply read the file names from an Excel worksheet and process them further!
In fact, this is relatively easy to do with Excel. To stick with the accounting example: With just a few mouse clicks, you can instruct Excel to simply import all the file names in a folder into a worksheet. Now you can even extract individual parts of the filename with minimal effort and paste them into another cell so you can analyze the flood of data.
Import File Names into an Excel Worksheet
To import the names of any number of files into an Excel worksheet, follow a process similar to the one used when importing .csv files into a worksheet.
First, go to the “Data” tab at the top and select the “Retrieve Data” drop-down menu. Under “Import Data,” select the “From File” option, then choose “From Folder.” A window will now open where you can select the folder containing the files you want to import.
When you click "OK," the "Excel Power Query" window opens. Here, you can view the retrieved data and, if needed, combine it with files from other folders by clicking "Combine."
Once you've selected all the data you want to insert into Excel, confirm your selection by clicking "Transform Data."
Edit Data Using the Power Query Editor
In the next step, you can edit the data in the “Power Query Editor” as needed. Here, for example, you can specify which data you want to display in the Excel worksheet later on. If you don’t want to include the data from a particular column, for instance, you can easily exclude it by clicking “Remove Columns.”
By clicking "Save & Load," you confirm your selection and insert the data into the active Excel worksheet.
Warning: Once you've entered the data, you can't undo it!
Processing the Data Further in Excel
If you want to further process the data in Excel, you'll run into the problem that you can't easily split the file names in the Excel Power Query Editor.
So if you want to split the filenames, you'll need to use functions like SUBST, LEFT, or RIGHT. We also have a detailed tutorial on this.
Here's a quick example:
To display the date in one cell and the invoice number in another cell in this example, use the SUBSTITUTE function. This function allows you to transfer parts of text from one cell to another.
So, for example, to enter the date in another cell, type the function
=PART(A2,1,10)
. Here, "TEIL" refers to the function, "A1" represents the cell from which the data is to be read, "1" is the first digit (or, in one case, letter) to be extracted, and "10" represents the number of characters to be extracted.
Now the date 11/13/2019 appears on its own in a cell. The function can easily be applied to the other dates.
If you apply this function to the other parts of the filenames as well, you can analyze a large number of filenames in no time at all.
About the authors
Wiresoft Editorial Team
The Wiresoft editorial team explains software, licenses, and how to use Windows, Office, and servers in a clear and practical way. The articles are based on questions that customers ask Wiresoft in their day-to-day lives.
Sources and further reading
- Microsoft Support: Help and Learning for ExcelSource date:
Matching productsOffice