Share via

Formatting problem when importing text data from a csv file

Anonymous
2011-02-20T20:13:42+00:00

Hi,

I frequently import data into excel from csv files.  In my data, I have to represent specific string patterns like "1+2" and "1-4".  Everything with a "+" works just fine and excel formats these cells as "General".  However, anything that has a "-" is interpreted as a date.  So for "1-4" I get "4-Jan" in a cell with a "Date" format. Try it out, you'll see.

How can I change this so that excel doesn't try to interpret my strings as dates?

I tried to manually change the formats of these cells to "General" or "Text", but then I just get some uninterpretable number...excel seems to have no memory of what was in the original csv file.  So I can't even figure out how to fix this problem manually for a single cell.  Any help?

Thanks!

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

HansV 462.6K Reputation points
2011-02-20T20:23:10+00:00

Change the extension from .csv to .txt.

This will cause the Text Import Wizard to appear when you open the file. In step 3, you will be able to specify that the column(s) have to be imported as text.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2011-02-20T20:32:16+00:00

    Thank you for the quick reply--what you suggested worked well.

    Was this answer helpful?

    0 comments No comments