Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Conversion from string to numeric with imported excel document

From   Nick Cox <>
Subject   Re: st: Conversion from string to numeric with imported excel document
Date   Wed, 3 Oct 2012 08:32:42 +0100

You need to give us an example of what is weird, after considering
whether this is just a precision problem.

See William Gould's blogs on precision at

For example, with

sysuse auto
edit gear_ratio

the first value 3.58 presents as 3.5799999 in the Data Editor I am
using now. This is perfectly normal.

For "STATA" read "Stata"


On Wed, Oct 3, 2012 at 2:25 AM, Ryan Stevens <> wrote:

> I'm having a very weird problem. I have imported an excel document
> which was generated from an online game me and my co-author are
> working with. Of course, when importing it into STATA the numeric
> values are stored as strings. However, in trying to convert from
> strings to numerics, it changes the values of the cells. I have tried
> both encode and destring commands. I also attempted to trim off any
> blank spaces, believing this may be an issue. Furthermore, I've tried
> manually removing any blank spaces or non-numeric values from the
> excel file and re-importing the document, and I still have the same
> problem. The odd thing is if I am looking at any given cell it will be
> the right value, however, when I click on the cell and view the value
> of the number at the top, it does not match what is showing in the
> specific cell. Any thoughts on how to resolve this problem would be
> greatly appreciated.
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index