Home  /  Products  /  Stata 12  /  Excel® import/export

Excel® import and export was introduced in Stata 12.

See the latest version of Excel® import and export. See all of Stata's data management features.

See the new features in Stata 18.


Excel® import and export

Stata for Windows, Mac*, and Linux can now directly import and export Microsoft Excel files. Both Excel 1997/2003 (.xls) files and Excel 2007/2010 (.xlsx) files are supported.

Above you see the preview tool, which you can use to see the data in an Excel worksheet before importing it and adjust options controlling how the data are imported.

import excel features

  • .xls and .xlsx support
  • import any worksheet from a workbook with multiple worksheets
  • import a custom cell range
  • treat first row of Excel data as Stata variable names
  • automatic conversion of Excel dates to Stata dates
  • automatic optimization of Stata storage types

export excel features

  • .xls and .xlsx support
  • replace an entire workbook
  • add a worksheet to an existing workbook
  • replace a single worksheet within an existing workbook
  • modify a subset of cells within an existing worksheet
  • save Stata variable names or variable labels to first row of worksheet
  • automatic conversion of Stata dates to Excel dates
  • export value labels or the underlying values
  • specify a custom missing-value code to use in worksheet

* import excel and export excel are not available on PowerPC-based Macs; all modern Macs are Intel-based and do support import excel and export excel.

Excel is a registered trademark of Microsoft.

Back to highlights

See New in Stata 18 to learn about what was added in Stata 18.