SOLVED

Prevent Excel from adding = to CSV files upon opening?

%3CLINGO-SUB%20id%3D%22lingo-sub-2883957%22%20slang%3D%22en-US%22%3EPrevent%20Excel%20from%20adding%20%3D%20to%20CSV%20files%20upon%20opening%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2883957%22%20slang%3D%22en-US%22%3E%3CP%3EIn%20our%20learning%20management%20system%2C%20we%20have%20to%20add%20a%20hyphen%20to%20the%20front%20of%20some%20online%20course%20titles%20to%20ensure%20they%20are%20sorted%20properly%20in%20the%20catalog.%20(A%20hyphen%20must%20be%20used%20because%20it%20is%20one%20of%20the%20only%20characters%20that%20is%20ignored%20by%20assistive%20technologies%20like%20screen%20readers.)%20The%20issue%20we're%20encountering%20is%2C%20when%20we%20export%20our%20course%20information%20to%20a%20CSV%20file%20and%20open%20it%20in%20Excel%2C%20Excel%20automatically%20adds%20an%20equals%20sign%20(%3D)%20at%20the%20beginning%20of%20any%20course%20title%20cells%20that%20begin%20with%20a%20hyphen%2C%20and%20it%20gives%20us%20a%20%23Name%3F%20error.%20It%20does%20this%20regardless%20of%20the%20number%20formatting%20assigned%20to%20the%20column%20because%2C%20presumably%2C%20Excel%20is%20adding%20the%20%3D%20as%20soon%20as%20it%20opens%20the%20CSV%20file.%20(I%20have%20confirmed%20that%20the%20%3D%20is%20not%20already%20in%20file%2C%20by%20opening%20it%20in%20Notepad%3B%20there%20are%20no%20equal%20signs%20in%20front%20of%20those%20course%20titles.)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe're%20able%20to%20remove%20the%20equal%20sign%20using%26nbsp%3B%20Find%20%26amp%3B%20Select%20%7C%20Replace%20feature%20on%20that%20column%2C%20but%20is%20there%20a%20way%20to%20prevent%20Excel%20from%20doing%20this%2C%20such%20as%20under%20File%20%7C%20Options%3F%20I%20have%20checked%20there%20and%20tried%20turning%20off%20a%20few%20options%2C%20but%20nothing%20fixes%20it.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20in%20advance%20for%20your%20help%2C%3C%2FP%3E%3CP%3ELSpirko%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2883957%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2884011%22%20slang%3D%22en-US%22%3ERe%3A%20Prevent%20Excel%20from%20adding%20%3D%20to%20CSV%20files%20upon%20opening%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2884011%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1195768%22%20target%3D%22_blank%22%3E%40lspirko%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDo%20not%20open%20CSV%20files%20with%20Excel.%20Instead%20import%20them%2C%20either%20with%20the%20text%20import%20assistant%20or%20with%20Power%20Query%20(best%20choice!)%20and%20set%20the%20data%20type%20to%20text%20for%20this%20field.%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

In our learning management system, we have to add a hyphen to the front of some online course titles to ensure they are sorted properly in the catalog. (A hyphen must be used because it is one of the only characters that is ignored by assistive technologies like screen readers.) The issue we're encountering is, when we export our course information to a CSV file and open it in Excel, Excel automatically adds an equals sign (=) at the beginning of any course title cells that begin with a hyphen, and it gives us a #Name? error. It does this regardless of the number formatting assigned to the column because, presumably, Excel is adding the = as soon as it opens the CSV file. (I have confirmed that the = is not already in file, by opening it in Notepad; there are no equal signs in front of those course titles.)

 

We're able to remove the equal sign using  Find & Select | Replace feature on that column, but is there a way to prevent Excel from doing this, such as under File | Options? I have checked there and tried turning off a few options, but nothing fixes it. 

 

Thank you in advance for your help,

LSpirko

2 Replies
best response confirmed by lspirko (New Contributor)
Solution

@lspirko 

Do not open CSV files with Excel. Instead import them, either with the text import assistant or with Power Query (best choice!) and set the data type to text for this field.

@Detlef Lewin -- Thank you for your prompt and very helpful response! I had no idea you can import data from a CSV instead of open it, but this seems to be have worked! I'll convey these steps to our LMS administrator. Much appreciated! LSpirko