How do I get a .csv file, text formatted date to not to be converted to the date format in Excel
Use the file processing dialogue rather than simply opening the .csv/.txt file in Excel.
The dialog appears via Data Menu > Get & Transfrom Data group > Get Data button > From File option > From Text/CSV sub-option after a file is selected using the standard file picker. The file processing dialogue should allow fields to be imported as as-is. This prevents the import routine from applying its "intelligence" (decision rules) and "deciding" how the content in the file gets converted to values in the worksheet.
The following test file
was was selected for import and, after selecting the file, the file processing dialog appeared as
Note that the dialog was effectively indicating that "Nov-24" in the .txt file would be imported as the date 01/11/2024 (or 11/01/2024 under the mm/dd/yyyy convention).
However, by selecting "Do not detect data types", in the control labelled "Data Type Detection" this was prevented.
The imported data looks like
As can be observed from the formula in cell E2
, the value Nov-24
showing in cell A2
is not a number (and therefore not a date), just a text string (though it loses the double quotes present in the .txt file).
In fact, all the values imported were treated as text strings when "Do not detect data types" was selected, including the numbers 12, 87.2, 25 and 42.1.
The above was undertaken using Office 365. Earlier versions of Excel have quite different versions of the file import dialog and, if memory serves, allow more control at the column level (so allowing only some columns to be imported as text strings).