Excel - Maple Help

Excel (.xlsx, .xls) File Format

Excel file format

Description

 • The Excel spreadsheet format is the native file format of Microsoft® Excel.
 • The name refers both to the Excel Binary File Format (.xls) in use until Excel 2007, and to the Office Open XML spreadsheet format (.xlsx) in use by Excel 2007 and later revisions.
 • The ExcelTools package allow detailed control over import and export of Excel spreadsheets.
 • The general-purpose commands Import and Export also support this format.
 • The default output from Import for this format is a DataFrame. To produce a Matrix, use Import(...,output=Matrix).

Examples

Import data from an Excel spreadsheet.

 > $M≔\mathrm{Import}\left("Excel/ExperimentalData.xls",\mathrm{base}=\mathrm{datadir}\right)$
 ${M}{≔}\begin{array}{c}\left[\begin{array}{cccccccc}{}& {\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{\mathrm{Time}}{}\left({\mathrm{value}}{,}{c}{,}{\mathrm{clock}}{=}{\mathrm{clock}}\right)\right]\right)& {\mathrm{Concentration A}}& {\mathrm{Concentration CO2}}& {\mathrm{Concentration AT}}& {\mathrm{Concentration B}}& {\mathrm{Concentration C}}& {\mathrm{Concentration A.B}}\\ {1}& {0.}& {0.54399}& {0.00121}& {0.0048}& {0.00722}& {0.00079}& {0.34423}\\ {2}& {20.0}& {0.27837}& {0.00082}& {0.10339}& {0.0037}& {0.01434}& {0.09162}\\ {3}& {40.0}& {0.23812}& {0.00108}& {0.12503}& {0.00124}& {0.01963}& {0.03804}\\ {4}& {60.0}& {0.25123}& {0.00116}& {0.13997}& {0.00087}& {0.021306971198003958}& {0.01886}\\ {5}& {80.0}& {0.17516}& {0.00116}& {0.15019}& {0.00081}& {0.021936407755005834}& {0.00748}\\ {6}& {100.0}& {0.16417}& {0.00117}& {0.1519}& {0.00014}& {0.0221874098363514}& {0.00115}\\ {7}& {120.0}& {0.15602}& {0.00117}& {0.16305}& {0.00020}& {0.02237884124114651}& {0.00954}\\ {8}& {140.0}& {0.12959}& {0.00122}& {0.16015}& {0.00057}& {0.022506852176574128}& {0.00101}\\ {9}& {160.0}& {0.12445}& {0.00121}& {0.16747}& {0.00025}& {0.022601444739028174}& {0.00137}\\ {10}& {180.0}& {0.14011}& {0.00117}& {0.16607}& {0.00033}& {0.02267553942113725}& {0.00010}\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{11 x 7 DataFrame}}\end{array}$ (1)

Import data from an Excel spreadsheet as a Matrix.

 > $M≔\mathrm{Import}\left("Excel/ExperimentalData.xls",\mathrm{base}=\mathrm{datadir},\mathrm{output}=\mathrm{Matrix}\right)$
 ${M}{≔}\begin{array}{c}\left[\begin{array}{ccccccc}{"Time"}& {"Concentration A"}& {"Concentration CO2"}& {"Concentration AT"}& {"Concentration B"}& {"Concentration C"}& {"Concentration A.B"}\\ {0.}& {0.54399}& {0.00121}& {0.0048}& {0.00722}& {0.00079}& {0.34423}\\ {20.0}& {0.27837}& {0.00082}& {0.10339}& {0.0037}& {0.01434}& {0.09162}\\ {40.0}& {0.23812}& {0.00108}& {0.12503}& {0.00124}& {0.01963}& {0.03804}\\ {60.0}& {0.25123}& {0.00116}& {0.13997}& {0.00087}& {0.021306971198003958}& {0.01886}\\ {80.0}& {0.17516}& {0.00116}& {0.15019}& {0.00081}& {0.021936407755005834}& {0.00748}\\ {100.0}& {0.16417}& {0.00117}& {0.1519}& {0.00014}& {0.0221874098363514}& {0.00115}\\ {120.0}& {0.15602}& {0.00117}& {0.16305}& {0.00020}& {0.02237884124114651}& {0.00954}\\ {140.0}& {0.12959}& {0.00122}& {0.16015}& {0.00057}& {0.022506852176574128}& {0.00101}\\ {160.0}& {0.12445}& {0.00121}& {0.16747}& {0.00025}& {0.022601444739028174}& {0.00137}\\ {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}& {⋮}\end{array}\right]\\ \hfill {\text{12 × 7 Matrix}}\end{array}$ (2)

To perform the following example, you should create an Excel spreadsheet named Employees.xlsx with the necessary sheets and cells.

 > $Q≔\mathrm{ExcelTools}:-\mathrm{Import}\left("Employees.xlsx","Payroll","B2:C9"\right):$

Compatibility

 • With Maple 2016, the Import command applied to Excel files now produces DataFrame objects by default.