Frequently Asked Questions

  ADA/508 friendly site


American FactFinder: How do I replace the leading zeros in my database compatible (.csv) download when opening the download in Microsoft Excel (that is, GEO ID2)?

Database compatible format (.csv) downloads sometimes include geographic codes such as the GEO ID2 code, or FIPS codes in the G001 downloads.   When the download is imported into certain external programs, such as Microsoft Excel, leading zeros will be omitted by default, for instance for IDs that contain a two-digit number from 01 through 09. In Microsoft Excel, the leading zeros can be replaced as follows:  

  1. Highlight the cells in the GEO ID2 column that need the leading zeros added.

  2. Select the Format / Format Cells option in the Cells menu located under the Home tab options.

  3. In the Format Cells window, select the Number tab and then the Custom category. 

  4. In the textbox under the word "Type:" replace the word General with the appropriate format/combination of 0 and # symbols, where 0 will represent each leading 0 and  # will represent each  numeric digit in the GEO ID.  For example: 
    • A State level GEO ID will be 0#, such as 01 for Alabama
    • A County Level GEO ID will be 0####, such as 01001 for Autauga County, Alabama
    • A FIPS  county code will be 00#, such as 001 for Autauga County, Alabama in the G001 table

  5. Verify the number format code you want displayed is correct by looking at the format code sample box located just above the “Type:” textbox.  Make any changes to the number format code until the sample that is displayed is the correct format.

  6. Click OK and the highlighted cells will update with the new number format code.  


Was this answer helpful?