Stopping Date Parsing when Opening a CSV File

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.