Excel Applies Scientific Notation to Imported Data

Written by Allen Wyatt (last updated March 6, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003


Rick constantly uses ODBC and Microsoft Query to import data into a workbook, and Excel destroys the part numbers as they are imported. For example, part number "04E-106" is imported as 4.00E-106 with general formatting. The cell content after import is 4E-106, but that's not the correct part number. Rick wonders how to stop Excel from parsing the incoming data as a number in scientific notation.

This problem was already addressed in a different ExcelTip, relative to working with data imported from a CSV file:

http://excel.tips.net/T002426

The same cause of the problem detailed in that tip applies here, as well: Excel is interpreting the imported data as a number when it should be interpreting it as text. The general solution is to make sure that the cells into which your information will be imported are formatted as text before you actually do the import.

In most cases this will solve the problem. In some cases, however, you may need to look at the code you are using to do your import query. For instance, you may now be using the following command to import part numbers from your ODBC source:

SELECT part_num from ODBC.table

This simply brings the part number in from the source database without any changes; Excel then parses the incoming data trying to figure out what type of data it is. Instead you need to change the command in this way:

SELECT "'" + part_num AS part_num from ODBC.table

Note that this approach places an apostrophe at the beginning of the part number field as it is imported. This doesn't stop Excel from parsing the part number, but the added apostrophe forces Excel to treat the part number as text rather than a number.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (7483) applies to Microsoft Excel 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Using Object Anchors

An object anchor is used to signify the point at which an object is inserted into a document. If you want to see these ...

Discover More

Searching for Multi-Byte Hex Codes

Need to find a character for which you only know the hex code? There are a few ways you can search for the information, ...

Discover More

Removing a Macro from a Shortcut Key

When you assign a macro to a shortcut key, you make it easy to run the macro without ever removing your hands from the ...

Discover More

Professional Development Guidance! Four world-class developers offer start-to-finish guidance for building powerful, robust, and secure applications with Excel. The authors show how to consistently make the right design decisions and make the most of Excel's powerful features. Check out Professional Excel Development today!

More ExcelTips (menu)

Getting Rid of Empty Rows after Importing

Import data into a worksheet (or paste it there) and you may find that you end up with a group of blank cells you need to ...

Discover More

Converting Imported Information to Numeric Values

If the information you import into Excel is treated as text by the program, you may want to convert it to numeric values. ...

Discover More

Changing Links

If your worksheet is linked to data in other worksheets, you may need to change the link from time to time. Here's how to ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is five less than 7?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.