# Another Excel question (exporting to CSV) - need help fast

**URL:** <https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452>\
**Category:** Factual Questions\
**Created:** [August 18, 2008, 6:02pm UTC](https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452 "2008-08-18T18:02:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roderick\_Femm](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/roderick_femm/32/14875_2.png) [@Roderick\_Femm](https://boards.straightdope.com/u/Roderick_Femm)\
**Post date:** [August 18, 2008, 6:02pm UTC](https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452/1 "2008-08-18T18:02:40Z")

</div>

I need to save a file that has a column of numbers with leading zeroes (they are account numbers) as a CSV file, but the leading zeroes drop off. I have tried formatting the column as text first, but the leading zeroes still drop off.

A colleage suggested I add quotes around the account numbers in Excel before saving as CSV file, but I can’t figure out how to do that. The Concatenate function doesn’t seem to work with quotes.

Thanks in advance,  
Roddy

---

<div class="post-metadata">

**Author:** ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)\
**Post date:** [August 18, 2008, 6:04pm UTC](https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452/2 "2008-08-18T18:04:38Z")

</div>

Stick a ’ in front of the number. That will cause Excel to interpret it as text.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [August 18, 2008, 6:09pm UTC](https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452/3 "2008-08-18T18:09:23Z")

</div>

Format Cells-\>Number-\>Custom-\>Type in required number of zeros.

---

<div class="post-metadata">

**Author:** ![Roderick\_Femm](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/roderick_femm/32/14875_2.png) [@Roderick\_Femm](https://boards.straightdope.com/u/Roderick_Femm)\
**Post date:** [August 18, 2008, 6:16pm UTC](https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452/4 "2008-08-18T18:16:21Z")

</div>

[QUOTE=ultrafilter]  
Stick a ’ in front of the number. That will cause Excel to interpret it as text.  
[/QUOTE]  
A suggestion on how to do that to 1600+ records, other than manually?

---

<div class="post-metadata">

**Author:** ![Roderick\_Femm](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/roderick_femm/32/14875_2.png) [@Roderick\_Femm](https://boards.straightdope.com/u/Roderick_Femm)\
**Post date:** [August 18, 2008, 6:18pm UTC](https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452/5 "2008-08-18T18:18:40Z")

</div>

[QUOTE=beowulff]  
Format Cells-\>Number-\>Custom-\>Type in required number of zeros.  
[/QUOTE]  
Thanks for the suggestion, but this did not work when exporting to CSV format.

---

<div class="post-metadata">

**Author:** ![Lobsang](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/lobsang/32/4067_2.png) [@Lobsang](https://boards.straightdope.com/u/Lobsang)\
**Post date:** [August 18, 2008, 6:20pm UTC](https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452/6 "2008-08-18T18:20:34Z")

</div>

The solution to this problem is to hate Microsoft a bit more.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [August 18, 2008, 6:24pm UTC](https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452/7 "2008-08-18T18:24:48Z")

</div>

[QUOTE=Roderick Femm]  
Thanks for the suggestion, but this did not work when exporting to CSV format.  
[/QUOTE]

Well, it works on Excel 2004 for OS X, sorry.

---

<div class="post-metadata">

**Author:** ![Roderick\_Femm](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/roderick_femm/32/14875_2.png) [@Roderick\_Femm](https://boards.straightdope.com/u/Roderick_Femm)\
**Post date:** [August 18, 2008, 6:28pm UTC](https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452/8 "2008-08-18T18:28:05Z")

</div>

OK, never mind, it’s only when I re-open the CSV file in Excel that the leading zeroes are missing; if I open with WordPad they are there. That’s all I needed.  
Roddy

---

<div class="post-metadata">

**Author:** ![Giles](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/giles/32/60_2.png) [@Giles](https://boards.straightdope.com/u/Giles)\
**Post date:** [August 18, 2008, 6:35pm UTC](https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452/9 "2008-08-18T18:35:02Z")

</div>

If you moving data into Excel with leading zeroes that you want to keep, you should format the block of cells that might have leading zeroes as text before pasting that data into Excel. I don’t think that will help with opening a CSV file directly into Excel, but if WordPad keeps the leading zeroes, you could copy that data in WordPad then paste into Excel (using Paste Special, with with Paste Values).

---

<div class="post-metadata">

**Author:** ![redtail23](https://avatars.discourse-cdn.com/v4/letter/r/3e96dc/32.png) [@redtail23](https://boards.straightdope.com/u/redtail23)\
**Post date:** [August 18, 2008, 6:42pm UTC](https://boards.straightdope.com/t/another-excel-question-exporting-to-csv-need-help-fast/460452/10 "2008-08-18T18:42:05Z")

</div>

Alternatively, rename the file to “.txt” instead of “.csv”. Then Excel will give you the import wizard where you can specify that the column is text instead of numeric; change it to TEXT type to retain the leading zeroes.

Or use Import External Data from the Data menu in Excel to get the wizard, instead of renaming the file.

(I swear there used to be one way to open CSV files and get the wizard, but they “fixed” that in O2003.)
