Here’s how to insert file names in Excel!
If a lot of files build up over a long period of time, things 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 whole pile of files tends to accumulate. Take a company’s accounts, for example: over the course of a year, lots of invoices pile up, all of which end up in a single folder where it’s easy to lose track of them.
Wouldn’t it be great if we could simply extract the file names from an Excel worksheet and process them further!
In fact, this is relatively easy to do in Excel. To stick with the bookkeeping example: with just a few clicks of the mouse, you can instruct Excel to simply copy all the file names in a folder into a worksheet. Now you can even extract individual parts of the file name with minimal effort and paste them into another cell, so that you can analyse the flood of data.
Importing file names into an Excel worksheet
To import the names of any number of files into an Excel worksheet, follow a similar procedure to that used when importing .csv files into a worksheet.
First, switch to the ‘Data’ tab at the top and select the ‘Retrieve data’ drop-down menu. Under ‘Retrieve data’, select the ‘From file’ option and then choose ‘From folder’. A window will now open where you can select the folder containing the files you wish to retrieve.
Clicking ‘OK’ opens the ‘Excel Power Query’ window. Here you can view the data that has been retrieved and, if necessary, combine it with files from other folders by clicking ‘Combine’.
Once you have selected all the data you want to paste into Excel, confirm your selection by clicking on ‘Transform data’.
Editing data using the Power Query Editor
In the next step, you can edit the data in the ‘Power Query Editor’ as you wish. Here, for example, you can specify which data you want to display in the Excel worksheet later on. If, for example, you do not want to include the data from a particular column, you can simply exclude it by clicking on ‘Remove columns’.
By clicking on ‘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 process the data further in Excel, you’ll run into the problem that you can’t simply split the file names apart in the Excel Power Query Editor.
So, if you want to split the file names, you’ll need to use functions such as SUBST, LEFT or RIGHT. We’ve also got a detailed tutorial on this.
To give a brief example:
To display the date in one cell and the invoice number in the other cell in this example, use the SUBSTITUTE function. This allows you to transfer parts of a 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’ stands for the cell from which the data is to be extracted, ‘1’ is the first digit (or, in one case, letter) to be extracted, and ‘10’ represents the number of characters to be extracted.
The date 13 November 2019 now 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 file names as well, you can analyse a large number of file names in no time at all.
About the authors
Wiresoft Editorial Team
The Wiresoft editorial team explains software, licences and how to use Windows, Office and servers in a clear and practical way. The articles are based on the questions that customers ask Wiresoft in their day-to-day lives.
Sources and further reading
Matching productsOffice