Import data from an Excel spreadsheet
Import(file, sheet, cells, emptycell=value)
(optional in Standard interface) string; the name of the Excel file from which to import data
(optional) string or positive integer; the name or index of the sheet from which to import data (default: 1)
(optional) string; the cell range to import (default: the entire sheet)
(optional) anything; the value given to blank cells in the spreadsheet (default is 0.0)
The Import(file,sheet,cells) function imports the data from the Microsoft Excel workbook file, as addressed by the sheet and cells parameter, into a Matrix.
Both the XLSX (Office Open XML) and XLS (Excel 97-2003) file formats are supported.
In the Standard interface, if the file parameter is not provided, a dialog will be presented with a field for the target file name. In all other interfaces, the file parameter is required.
The sheet parameter can be either the name of a sheet within the file or a 1-based index.
The cells parameter can be a standard cell range, for example, "A1:B9" or "c$10..$w15", or a named range. If it is given as a named range, that name must already exist in the Excel file.
If cells is given as a single cell address, for example "D13", this is taken as the top-left corner of the required range, with the bottom-right corner taken to be the bottom-right corner of the sheet. (To import just a single cell, specify it as a range, for example "AQ3:AQ3".)
Spreadsheets can contain empty cells in the midst of other data. By default these cells are given the value 0.0 upon import. Use the emptycell option to specify a different value. For example, emptycell=undefined, or emptycell="".
To perform the following examples, you should create an Excel spreadsheet named Employees.xlsx with the necessary sheets and cells.
Indexing only the upper left corner brings in all the rest of the sheet
A cell range can be specified via a name
Sheets can be indexed as well as named
Import all of the first (or only) sheet
(Standard interface only) Open a dialog to enter the file name and other data
Download Help Document
What kind of issue would you like to report? (Optional)