
Contents
Introduction to CSV Files
CSV stands for Comma-Separated Values. It is a plain-text file format that is commonly used to store and exchange data in a simple and portable way. CSV files consist of rows and columns of data, with each row representing a record or entry, and each column representing a field or attribute of that record.
The values in each row are separated by commas (or other delimiters like semicolons or tabs), and each row is separated by a newline character. CSV files can be opened and edited in any text editor or spreadsheet program, including Microsoft Excel and Google Sheets.
Use and Purpose of CSV Files
CSV files are widely used in data processing and analysis, and can be used for a variety of purposes, including:
- Data import/export: CSV files are a common format for importing and exporting data between different applications and systems.
- Data storage: CSV files can be used to store data in a simple and structured format that is easy to work with and share.
- Data analysis: CSV files can be easily loaded into spreadsheet programs or data analysis tools for further analysis and manipulation.
- Data sharing: CSV files can be easily shared with others via email, cloud storage services, or other file-sharing methods.
- Database backups: CSV files can be used as a backup format for small databases or tables, as they are easy to export and import.
Overall, CSV files provide a simple and effective way to store and exchange data, and are widely used in many different industries and applications.
Ways to Convert CSV into Excel Format
There are various ways to convert CSV File to XLSX format. Some of the ways are listed below. All the steps written below has been tried and tested before writing down here –
- Using Excel’s built-in Text Import Wizard
- Using Excel’s Power Query feature
- Using a third-party or online conversion tool
- Using VBA for batch convert CSV to XLSX
Now let us learn all the process listed above in detail.
Using Excel's Built in Text Import Wizard
Follow the steps given below to convert CSV file into XLSX format –
- Open a new workbook in Excel.
- Click on the “Data” tab and select “From Text/CSV” in the “Get External Data” section.
- Alternatively, you can use keyboard shortcuts as well. For Windows, press Alt + A + E keys and for MacOS, press Command + Option + R keys.
- Browse to the location where the CSV file is stored and select the file.
- Follow the Text Import Wizard steps to specify the delimiter, data format, and column headers.
- Once the data is imported, you can save the file as an Excel workbook.

Using Excel's Power Query Feature
Follow the steps given below to convert CSV file into XLSX format –
- Open a new workbook in Excel.
- Click on the “Data” tab and select “From Text/CSV” in the “Get External Data” section.
- Browse to the location where the CSV file is stored and select the file.
- In the Power Query Editor window, you can transform the data as needed, such as renaming columns or splitting data into multiple columns.
- Once you have transformed the data, you can load it into Excel as a new table or overwrite an existing table.


Using Third party's or Online Conversion Tools
Follow the steps given below to convert CSV file into XLSX format –
- There are many third-party tools available that can convert CSV files to Excel format, such as
- These tools typically allow you to upload a CSV file and select the desired output format, such as Excel or CSV with delimiter.
- Once the conversion is complete, you can download the converted file to your computer.


Using VBA to batch convert CSV into XLSX format
Sometimes, while working with large chunk of database, you will require conversion of CSV files in batches. Hence, to convert multiple CSV files from one folder to XLS(X) files, you can follow the steps below –
- Firstly, ensure that all the CSV Files you want to convert are closed and not running. Now, enable a new workbook, press Alt + F11 keys to open Microsoft Visual Basic for Applications window, and click Insert > Module. See screenshot:

- Then paste below macro code to the Module script, and press F5 key to run the code.
Sub CSVtoXLS() 'UpdatebyExtendoffice20170814 Dim xFd As FileDialog Dim xSPath As String Dim xCSVFile As String Dim xWsheet As String Application.DisplayAlerts = False Application.StatusBar = True xWsheet = ActiveWorkbook.Name Set xFd = Application.FileDialog(msoFileDialogFolderPicker) xFd.Title = "Select a folder:" If xFd.Show = -1 Then xSPath = xFd.SelectedItems(1) Else Exit Sub End If If Right(xSPath, 1) <> "\" Then xSPath = xSPath + "\" xCSVFile = Dir(xSPath & "*.csv") Do While xCSVFile <> "" Application.StatusBar = "Converting: " & xCSVFile Workbooks.Open Filename:=xSPath & xCSVFile ActiveWorkbook.SaveAs Replace(xSPath & xCSVFile, ".csv", ".xlsx", vbTextCompare), xlWorkbookDefault ActiveWorkbook.Close Windows(xWsheet).Activate xCSVFile = Dir Loop Application.StatusBar = False Application.DisplayAlerts = True End Sub
- If you want to convert CSV into XLS (Not XLSX), then use the code below –
Sub CSVtoXLS()
'UpdatebyExtendoffice20170814
Dim xFd As FileDialog
Dim xSPath As String
Dim xCSVFile As String
Dim xWsheet As String
Application.DisplayAlerts = False
Application.StatusBar = True
xWsheet = ActiveWorkbook.Name
Set xFd = Application.FileDialog(msoFileDialogFolderPicker)
xFd.Title = "Select a folder:"
If xFd.Show = -1 Then
xSPath = xFd.SelectedItems(1)
Else
Exit Sub
End If
If Right(xSPath, 1) <> "\" Then xSPath = xSPath + "\"
xCSVFile = Dir(xSPath & "*.csv")
Do While xCSVFile <> ""
Application.StatusBar = "Converting: " & xCSVFile
Workbooks.Open Filename:=xSPath & xCSVFile
ActiveWorkbook.SaveAs Replace(xSPath & xCSVFile, ".csv", ".xls", vbTextCompare), xlNormal
ActiveWorkbook.Close
Windows(xWsheet).Activate
xCSVFile = Dir
Loop
Application.StatusBar = False
Application.DisplayAlerts = True
End Sub
- In the popping out dialog, select the specified folder containing the CSV files you want to convert. See screenshot:

- Click OK, all the CSV files in the selected folder have been converted to XLS files in it.
Conclusion
In conclusion, converting CSV files to Excel format is a simple and straightforward process that can be done using Excel’s built-in Text Import Wizard or Power Query feature, or by using a third-party conversion tool.
By following the steps outlined in this tutorial, you can quickly and easily import data from a CSV file into Excel, and manipulate it as needed to perform analysis or create reports. Whether you are a business professional, data analyst, or casual user, knowing how to convert CSV files to Excel format can be a valuable skill that will save you time and effort in your work.