Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Stopping Date Parsing when Opening a CSV File.

Stopping Date Parsing when Opening a CSV File

Written by Allen Wyatt (last updated July 7, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


1

Marc has a user at his company who is trying to open a .CSV file in Excel. Some of the numbers in the file are in the format of "2-1" (or something similar). During the import, Excel parses this information as a date. If the piece of data is clearly something outside a valid date range (such as 2-134), then Excel imports it as would be expected. Marc is wondering how his user can force Excel to not parse this data as dates but to import them as text fields.

There at two easy ways you can approach this issue. First is to import the file in the following manner:

  1. Display the Data tab of the ribbon.
  2. Click From Text in the Get External Data group. Excel displays a standard Open dialog box.
  3. Use the controls in the dialog box to select the .CSV file you would like to open and then click Open. Excel starts up the Text Import Wizard. (See Figure 1.)
  4. Figure 1. The Text Import Wizard.

  5. Go through the steps of the Text Import Wizard to specify how Excel should interpret the data that it imports from the .CSV file. In one of those steps you can indicate that the non-date columns (the ones incorrectly interpreted as dates) are actually text.
  6. When you are done with the steps of the wizard, click Finish. Your data is imported in accordance with your specifications.

The other way to approach the issue also involves the Text Import Wizard, but how you display it is different. In this approach, you use Windows to rename the file so that it has a .TXT extension instead of a .CSV extension. Now, when you use Excel to open the file, it displays the Text Import Wizard because it isn't quite sure how to interpret what it is going to be loading. You can use the Text Import Wizard in the same manner as already described earlier in this tip.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (9179) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365. You can find a version of this tip for the older menu interface of Excel here: Stopping Date Parsing when Opening a CSV File.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Selectively Importing Records

Want to easily control which records get imported from a text file into Excel? It's easy to do when you write the macro ...

Discover More

Resetting Page Setup

If you ever open a workbook and find that your carefully crafted worksheets no longer print on the number of pages you ...

Discover More

Adding a Macro to the Quick Access Toolbar

The Quick Access Toolbar is a great place to put anything for which you want quick access. (Duh!) Here's how you can add ...

Discover More

Save Time and Supercharge Excel! Automate virtually any routine task and save yourself hours, days, maybe even weeks. Then, learn how to make Excel do things you thought were simply impossible! Mastering advanced Excel macros has never been easier. Check out Excel 2010 VBA and Macros today!

More ExcelTips (ribbon)

Loading Unwanted Files at Startup

Imagine how painful it would be if every time you started Excel it tried to load all the files in your root directory? ...

Discover More

Locked File Puzzle

What would you do if every time you opened a workbook Excel told you it was locked? Here's how you can try to recover ...

Discover More

Faster Text File Conversions

Want to make your importing of text data faster than ever? Here are some ideas you can apply right away.

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine minus 5?

2023-07-07 08:13:16

mark watson

If Marc thinks this import will be a repeating process, I suggest he (or his user) use Power Query to do the import. That way the import process can be virtually completely automated.

There's a lot of resources on Power Query and how to do this type of import.

I've used Skillwave extensively (no financial interest) and have been very impressed. Skillwave offers a free course, "Power Query Fundamentals" that's 2 1/2 hours of introductory information.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.