Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: exporting formulas from stata to excel
From
Eric Stradley <[email protected]>
To
[email protected]
Subject
st: exporting formulas from stata to excel
Date
Tue, 14 Feb 2012 18:58:19 -0500
Statalisters,
I have used stata12 to create string variables that contain excel-type
formulas. Ideally, I would like to export a stata .dta file into excel
that evaluates the formulas.
For instance, I have a variable AZ that corresponds to column AZ in my
excel notebook and contains something like
=IF(AY12="","",AY12/BT12)
I've exported the data as text with a unique delimiter, like ";", but
then I still have to text-to-column in each spreadsheet which
surprisingly seems to run up against some variable width issues in excel
(I have some much longer formulas). Additionally, the point of the
exercise is to cleverly fill down the formulas according to _n in stata
and avoid having to fill down in excel, which can get tedious across
many notebooks and rows. That said, I thought I would take advantage of
stata12's export excel command, and when I do so I get something of the
form:
AZ
=IF(AY12="","",AY12/BT12)
which seems to be exactly what I want. However, the excel notebook
refuses to execute the formula unless I click into each individual cell,
which again is tedious and ruins the point of the exercise.
Sorry that this is more of an excel question than a Stata question, but
I am curious to know if anyone has tried this before and/or has any
suggestions. Thanks alot.
Eric
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/