Wolfram Language & System 10.0 (2014)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

XLS (.xls)

  • Import supports XLS files created by Excel 95, 97, 2000, XP, and 2003.
  • Export creates files compatible with the Excel 2000 standard.


    Registered MIME type: application/vnd.ms-excel
    Microsoft Excel spreadsheet file.
    XLS is an acronym derived from Excel Spreadsheet.
    Stores spreadsheet data and formulas.

Import and ExportImport and Export

  • Import["file.xls"] imports all sheets of an XLS file, returning the result as a list of arrays.
  • Export["file.xls",expr] exports an array or a list of arrays to XLS.
  • Import and Export also handle embedded images.
  • Import["file.xls"] returns the sheets of an XLS file as an expression of the form , where the are full arrays containing numerical and textual data, Boolean values, and date specifications.
  • Export["file.xls",expr] creates an XLS file from array data.
  • The following expression types are supported by Export: Column, Grid, List, MatrixForm, Row, SparseArray, and TableForm.
  • Import["file.xls",elem] imports the specified element from an XLS file.
  • Import["file.xls",{elem,suba,subb,}] imports a subelement.
  • Import["file.xls",{{elem1,elem2,}}] imports multiple elements.
  • The import format can be specified with Import["file","XLS"] or Import["file",{"XLS",elem,}].
  • Export["file.xls",expr, elem] creates an XLS file by treating expr as specifying element elem.
  • Export["file.xls",{expr1,expr2,},{{elem1,elem2,}}] treats each as specifying the corresponding .
  • Export["file.xls",expr,opt1->val1,] exports expr with the specified option elements taken to have the specified values.
  • Export["file.xls",{elem1->expr1,elem2->expr2,},"Rules"] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the XLS format.


  • General Import elements:
  • "Elements"list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Data representation elements:
  • "Data"list of full arrays, representing all sheets
    "Formulas"all XLS formulas as text
    "Images"embedded images as a list
  • Advanced data elements:
  • "FormattedData"data with some styling elements applied
  • See the reference page for "XLSX" for full documentation.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Import the first sheet of an Excel file:

Click for copyable input

Export a table to XLS:

Click for copyable input
Introduced in 2004
| Updated in 2010