Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Friedrich Huebler <fhuebler@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: RE: Strings dropped when importing Excel file |
Date | Fri, 8 Nov 2013 14:17:38 -0500 |
Thank you, Joe. This works. Stata now imports #N/A as "#N/A (same for #DIV/0! and #VALUE!) and no information is lost. Friedrich On Fri, Nov 8, 2013 at 1:56 PM, Joe Canner <jcanner1@jhmi.edu> wrote: > Freidrich, > > -import excel- is fairly clever at figuring out the correct type and format of Excel spreadsheet variables, including, apparently, error/missing codes. The only solution I can think of is to add a single quote before the "#N/A" and "#VALUES!". This will trick Excel and Stata into thinking these are truly strings and not special codes. > > Regards, > Joe Canner > Johns Hopkins University School of Medicine > > -----Original Message----- > From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Friedrich Huebler > Sent: Friday, November 08, 2013 1:24 PM > To: statalist@hsphsun2.harvard.edu > Subject: st: Strings dropped when importing Excel file > > I use Stata 12.1. When importing an Excel file with string variables (cell format "Text"), the variables are correctly imported as strings but the following entries are replaced by empty cells in Stata: > > #N/A > #VALUE! > > Is it possible to keep these strings? I found no information on this in the documentation for -import excel-. The -allstring- option makes no difference. > > Thanks, > > Friedrich * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/