Whether you’re generating financial reports, processing your accounts for month end, or simply moving information between data sources to analyze it for valuable insights, chances are you’ll need to get external data (e.g., access a text-based file format like a comma separated values (CSV) document). And when you do, it’s also probable you’ll do so by importing it from a text file into one of the most common applications for handling CSV files: Microsoft Excel.
The actual process for creating an excel workbook from text files like the CSV format is fairly straightforward. But it’s important to follow the process exactly to avoid potential pitfalls and make sure your data makes the transition smoothly and completely.
Why Knowing How to Open CSV Files in Excel Matters
Native Microsoft Excel files (.xlsx files) are designed for that application and provide support for macros, separate data tabs, and other advanced features. They’re meant to be used both as part of the larger Microsoft Office suite and as a data manipulation and management tool that can import and process data for exporting to other applications.
CSV files (their file extension mirrors their name: .csv) are rarely accessed directly. Instead, they’re used for storing and transferring information that’s been broken into manageable chunks, such as calendar appointments, statistics, customer databases, contact information, etc. They don’t support macros or plug-ins or more advanced features, but that’s intentional, as once the data’s in Excel, it can be manipulated, connected to other workbooks, analyzed using pivot tables, etc.
NOTE: Despite the name of the format, data values may be separated by commas, semicolons, or other punctuation, depending on how the original was created.
They’re text-based (and can even be created in very simple text editor applications such as Notepad, and can be saved directly to, and created from, the .txt format), easy to create and use, and let you handle large amounts of information without worrying about being locked into a specific application.
CSV files come in four types:
- CSV UTF-8 (Eight-bit Unicode Transformation Format) (Comma delimited)
- CSV (Comma delimited)
- CSV (Macintosh)
- CSV (MS-DOS)
Each format has its distinct uses, but all four are supported by Microsoft Excel. That’s important, because it gives you more flexibility in managing your data; you can easily import from any of the formats and export copies to any of the four CSV formats (using the Save As…dialogue) for use in other applications as needed.
That said, while all four formats are supported natively, simply opening a CSV file rather than importing it into an excel worksheet will often result in a screen full of gibberish. Importing to an Excel sheet from the CSV file preserves the data’s utility and accessibility (It saves you the headache of trying to pick through an improperly formatted document, too!).
Given Excel’s large market share and the near ubiquity it shares with CSV files in the modern office environment, understanding how to import data from the CSV format to Excel is a critical skill for financial and other professionals who need to access, create, collect, and manage data across different platforms, in various file types, on a regular basis.
Importing to an Excel sheet from the CSV file preserves the data’s utility and accessibility (It saves you the headache of trying to pick through an improperly formatted document, too!).
Open CSV Files in Microsoft Excel the Right Way
Generally, you’ll rely on Excel’s built-in Import Text Wizard to help you get data from your CSV file into your existing Excel workbook (or a new worksheet). You can also try opening it directly from Excel’s File menu or with a double-click on the file in Explorer, but that can be an exercise in frustration if your settings aren’t properly configured.
Depending on your location and the version of Excel you’re using, Excel will rely on its localized Region and Language settings to make certain assumptions about files you use, and how files will most likely be formatted. This includes the “default” file separator; different regions have different delimiters. In the United States, for example, commas are most often used, but in Germany, it’s the semicolon that gets the heaviest usage.
Naturally, things can get even more complicated if you’re working with files created in other locations with different regional settings.
The more data you’re working with, and the more diverse your data sources, the higher the chances simply double-clicking to open a .csv file (or using the Open command) will end in woe rather than work-friendly data.
Another important caveat: while .txt files and .csv files are essentially the same in many ways, always save any .txt file you plan to import into Excel as a .csv file before trying to import it. You can do this very easily in Notepad by simply changing the extension to “.csv” in the “Save As…” dialogue.
To use the more complicated, but also much more reliable, Text Import Wizard:
- Open a New Excel Document, or open a new worksheet in your existing Excel workbook.
- Navigate to the “Data” tab.
- Click on the “From Text” button.
- Navigate to the folder holding the .csv file you want to open and click on the correct file name.
- Click “Import.”
- The Text Import Wizard will open. Make sure you choose the “Delimited” radio button/checkbox under “Original Data Type” in the open dialog box. If your data has headers, don’t forget to select the “My data has headers” checkbox as well.
- Click “Next.”
- Select the checkbox corresponding to the correct delimiter used in the original .csv document. This will usually be a comma or a semicolon, but could be a tab, a space, or even a special character. It’s important to choose the correct delimiter to ensure the data fields can be properly parsed during the import.
- Choose the correct text qualifier (usually double quotes) from the drop-down list.
- Click “Next.”
- In the Data Preview field, only the first column of data will be highlighted. Drag the horizontal window control all the way to the right.
- While holding down the Shift key, click on the final column heading. This should select and highlight every column in the Data Preview pane.
- Choose “Text” as your Column Data Format. Every column should now be labeled “Text” in the Data Preview pane.
- Review the Data Preview window to ensure your data looks the way it should.
- Click “Finish.”
- If prompted to select a location for your data (e.g., “Where do you want to put the data?”), click on whichever cell in the worksheet (or new workbook, or new worksheet in your existing workbook) you want to receive the first item in the .csv file and then click “OK.”
Your data should appear in your spreadsheet, organized in columns and, where relevant, with their original headers. If your data contained fields with leading zeros, double-check to make sure they made the transition through the Import Text Wizard.
Bringing CSV Data into Microsoft Excel Doesn’t Have to Be Difficult
When it comes to your data, it pays to be cautious, even when dealing with a relatively simple task like importing CSV data into Excel. By taking the time to practice proper protocols when you either open or import data from CSV files, you can save time and frustration, and make sure your information is complete and accurate for optimal reporting, analysis, and strategic planning.