Monday, May 03, 2010

Excel format cells with quotes

Here is how to format a text cell so it will have either double or single quotes. I needed to import a csv file with text fields formatted with double quotes. There are probably some more reasons why you might need to do this.

  • Edit the cell or column you need to format
  • choose format cell
  • Select Custom from the bottom
  • use the formula \"@\"

The @ symbol represents the text in the field. You can wrap any text field with any character but make sure to escape it.


Stumble Upon CodePyro

9 comments:

Anonymous said...

Thank you! Needed that!

Anonymous said...

Great tip Thank you

Anonymous said...

Thank you very much!!

Anonymous said...

Very handy, thank you!

Anonymous said...

doesn't work with numbers

Anonymous said...

If you want to format both (text and numbers), use \"#\";\"@\" as format.
Source http://www.databison.com/custom-format-in-excel-how-to-format-numbers-and-text/

Anonymous said...

Thank you so much! You just saved me SO much time!

Harsh Ahuja said...

wow- works like magic

Anonymous said...

It appears to work in Excel but when I open the document in Notepad, it has double quotes instead of single. Anyone know why?

Post a Comment