Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • Wolfram Notebook Assistant + LLM Kit

    All-in-one AI assistance for your Wolfram experience

  • System Modeler
  • Wolfram Player
  • Finance Platform
  • Wolfram Engine
  • Enterprise Private Cloud
  • Application Server
  • Wolfram|Alpha Notebook Edition
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • AI & Linguistic Understanding

Deployment Options

  • Wolfram Cloud
  • wolframscript
  • Wolfram Engine Community Edition
  • Wolfram LLM API
  • WSTPServer
  • Wolfram|Alpha APIs

From the Community

  • Function Repository
  • Community Paclet Repository
  • Example Repository
  • Neural Net Repository
  • Prompt Repository
  • Wolfram Demonstrations
  • Data Repository
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

  • Data & Computational Intelligence
  • Model-Based Design
  • Algorithm Development
  • Wolfram|Alpha for Business
  • Blockchain Technology
  • Education Technology
  • Quantum Computation

WolframConsulting.com

Wolfram Solutions

  • Data Science
  • Artificial Intelligence
  • Biosciences
  • Healthcare Intelligence
  • Sustainable Energy
  • Control Systems
  • Enterprise Wolfram|Alpha
  • Blockchain Labs

More Wolfram Solutions

Wolfram Solutions For Education

  • Research Universities
  • Colleges & Teaching Universities
  • Junior & Community Colleges
  • High Schools
  • Educational Technology
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM/STEAM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
Wolfram|Alpha
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • Wolfram Notebook Assistant + LLM Kit
    • System Modeler
    • Wolfram Player
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Wolfram Engine
    • Enterprise Private Cloud
    • Application Server
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • AI & Linguistic Understanding
    • Deployment Options
      • Wolfram Cloud
      • wolframscript
      • Wolfram Engine Community Edition
      • Wolfram LLM API
      • WSTPServer
      • Wolfram|Alpha APIs
    • From the Community
      • Function Repository
      • Community Paclet Repository
      • Example Repository
      • Neural Net Repository
      • Prompt Repository
      • Wolfram Demonstrations
      • Data Repository
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions

    We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

    WolframConsulting.com

    Wolfram Solutions

    • Data Science
    • Artificial Intelligence
    • Biosciences
    • Healthcare Intelligence
    • Sustainable Energy
    • Control Systems
    • Enterprise Wolfram|Alpha
    • Blockchain Labs

    More Wolfram Solutions

    Wolfram Solutions For Education

    • Research Universities
    • Colleges & Teaching Universities
    • Junior & Community Colleges
    • High Schools
    • Educational Technology
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM/STEAM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • Wolfram|Alpha
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
XLS (.xls)
  • See Also
    • Import
    • Export
    • CloudExport
    • CloudImport

    • Formats
    • XLSX
    • CSV
    • TSV
    • MDB
  • Related Guides
    • Basic Formats
    • Date & Time
    • Importing & Exporting
    • Importing & Exporting Database Formats
    • Listing of All Formats
    • Numerical Data
    • Statistics
    • Tabular & Spreadsheet Formats
    • See Also
      • Import
      • Export
      • CloudExport
      • CloudImport

      • Formats
      • XLSX
      • CSV
      • TSV
      • MDB
    • Related Guides
      • Basic Formats
      • Date & Time
      • Importing & Exporting
      • Importing & Exporting Database Formats
      • Listing of All Formats
      • Numerical Data
      • Statistics
      • Tabular & Spreadsheet Formats
IMPORT/EXPORT FORMAT
  • See Also
    • Import
    • Export
    • CloudExport
    • CloudImport

    • Formats
    • XLSX
    • CSV
    • TSV
    • MDB
  • Related Guides
    • Basic Formats
    • Date & Time
    • Importing & Exporting
    • Importing & Exporting Database Formats
    • Listing of All Formats
    • Numerical Data
    • Statistics
    • Tabular & Spreadsheet Formats
    • See Also
      • Import
      • Export
      • CloudExport
      • CloudImport

      • Formats
      • XLSX
      • CSV
      • TSV
      • MDB
    • Related Guides
      • Basic Formats
      • Date & Time
      • Importing & Exporting
      • Importing & Exporting Database Formats
      • Listing of All Formats
      • Numerical Data
      • Statistics
      • Tabular & Spreadsheet Formats

XLS (.xls)

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

Background & Context

    • 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 & Export

  • Import["file.xls"] imports all sheets of an XLS file, returning the result as a list of arrays.
  • Each sheet is imported as a full array containing numerical and textual data, Boolean values and date objects.
  • Import["file.xls",elem] imports the specified element from an XLS file.
  • Import["file.xls",{elem,sub1,…}] imports subelements specifically useful for partial data import.
  • The import format can be specified with Import["file","XLS"] or Import["file",{"XLS",elem,…}].
  • Export["file.xls",expr] exports an array or a list of arrays to XLS.
  • Supported expressions expr include:
  • {v1,v2,…}a single column of data
    {{v11,v12,…},{v21,v22,…},…}lists of rows of data
    arrayan array such as SparseArray, QuantityArray, etc.
    tseriesa TimeSeries, EventSeries or a TemporalData object
    Dataset[…]a dataset
    Tabular[…]a tabular object
    {data1,…}a list of data to be exported as sheets
  • Export["file.xls",{expr1,expr2,…},{{elem1,elem2,…}}] treats each expri as specifying the corresponding elemi.
  • Export["file.xls",{elem1->expr1,elem2->expr2,…},"Rules"] uses rules to specify the elements to be exported.
  • See the following reference pages for full general information:
  • Import, Exportimport from or export to a file
    CloudImport, CloudExportimport from or export to a cloud object
    ImportString, ExportStringimport from or export to a string
    ImportByteArray, ExportByteArrayimport from or export to a byte array

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Summary"summary of the file
    "Rules"list of rules for all available elements
  • Basic information element:
  • "Dimensions"association of sheet names and sheet dimensions
    "SheetCount"number of sheets
    "Sheets"list of sheet names
  • Data representation elements:
  • "Data"list of full arrays, representing all sheets
    "Dataset"list of Dataset objects, representing all sheets
    "FormattedData"data with some styling elements applied
    "Formulas"all formulas as text
    "Images"embedded images as a list
    "NamedRanges"associations of named ranges as spans
    "Tabular"list of Tabular objects, representing all sheets
    "TabularAssociation"association of sheet names and Tabular objects
  • Import and Export by default use the "Data" element.
  • Any data representation element can specify {elem,sheets,rows,cols} to extract parts of an XLS file.
  • Part specification sheet can be any of the following:
  • nnth sheet
    -ncounts from the end
    namesheet name
    n;;msheets n through m
    n;;m;;ssheets n through m with steps of s
    {n1,name,…}specific name or sheet index ni
  • Part specifications row and col can be any of the following:
  • nnth row or column
    -ncounts from the end
    n;;mfrom n through m
    n;;m;;sfrom n through m with steps of s
    {n1,n2,…}specific sheet index ni or name
  • XLS data is represented in the Wolfram Language by real or integer numbers, strings, Boolean values True and False, and DateList specifications.
  • Import["file.xls","Formulas"] gives the Excel formulas for each cell in the form {f1,f2,…}, where the fi are arrays corresponding to the sheets of an XLS file.
  • Import yields spreadsheets as full rectangular arrays.
  • Export supports full and ragged arrays.

Options

  • Import and Export options:
  • "EmptyField"""how empty cells are represented in Wolfram Language
  • Import options:
  • "HeaderLines"0number of lines to assume as headers
    "SkipLines"0number of lines to skip at the beginning of the file
  • Possible settings for "HeaderLines" and "SkipLines" are:
  • nn rows to skip or to use as Dataset headers
    {rows,cols}rows and columns to skip or to use as headers
  • Export options:
  • "ImageFormat""JPEG"format used for exporting images

Examples

open all close all

Basic Examples  (5)

Import the first sheet of an XLS file:

Import as a Tabular object:

Import summary of the file:

Embed graphics in an XLS file:

Import an embedded image from an XLS file:

Export the first 12 prime numbers to a spreadsheet:

Export two datasets to different sheets:

Scope  (8)

Import  (3)

Show the Import elements in a file:

Import the first sheet as a Tabular object:

Import all sheets as an association of sheet names and Tabular objects:

Export  (5)

Specify sheet names:

Import the cell at row 1, column 4 for a given sheet:

Import the second sheet:

Export date and date-time stamps:

Import converts a date into a DateObject:

Export raster images to XLS (automatically rasterizing vector graphics):

Import returns a list of images:

Raw bytes representing common image file formats can also be exported as images to XLS:

Export a Dataset:

Use the "HeaderLines" option to import table headers:

Import Elements  (16)

"Data"  (6)

Import an XLS file as a 3D list of values:

This is also the default element:

Import the first sheet of an XLS file:

Import a single row from a sheet in an XLS file:

Import a single column from a sheet in an XLS file:

Import the first 3 rows of a named sheet:

"Dataset"  (1)

Import the first sheet of an XLS file as a Dataset:

Use the first row as header:

"Dimensions"  (1)

Import the dimensions of the sheets in an XLS file:

"FormattedData"  (1)

Import XLS data, preserving basic formatting with Style:

"Formulas"  (1)

Import the raw data of all formula cells in an XLS file:

"Images"  (1)

Import an embedded image from an XLS file:

"NamedRanges"  (1)

Get named ranges in an XLS file:

Import a specific range of data:

"SheetCount"  (1)

Import the number of sheets in an XLS file:

"Sheets"  (1)

Import the names of the sheets in an XLS file:

"Tabular"  (1)

Import the first sheet of an XLS file as a Tabular:

Use the first row as header:

"TabularAssociation"  (1)

Import all sheet as an association of sheet names and Tabular objects:

Import Options  (6)

"EmptyField"  (1)

Some XLS files may contain empty cells. Create a file with some empty fields:

By default, empty fields are imported as empty strings "":

Specify the value of empty fields:

"HeaderLines"  (4)

By default, a header line is detected automatically:

Specify column headers:

Specify row headers:

Specify row and column headers:

"SkipLines"  (1)

Some XLS sheets may include a comment line.

Skip the comment line:

Skip the comment line, and use the next line as a Dataset header:

Possible Issues  (2)

The top-left corner of data is lost when importing a Dataset with row and column headers:

Dataset may look different depending on the dimensions of the data:

See Also

Import  Export  CloudExport  CloudImport

Formats: XLSX  CSV  TSV  MDB

Related Guides

    ▪
  • Basic Formats
  • ▪
  • Date & Time
  • ▪
  • Importing & Exporting
  • ▪
  • Importing & Exporting Database Formats
  • ▪
  • Listing of All Formats
  • ▪
  • Numerical Data
  • ▪
  • Statistics
  • ▪
  • Tabular & Spreadsheet Formats

Related Links

  • ▪ How to: Export a Spreadsheet

History

Introduced in 2004 (5.1) | Updated in 2019 (12.0) ▪ 2020 (12.2) ▪ 2024 (14.0) ▪ 2025 (14.2)

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • Notebook Assistant + LLM Kit
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Player
  • Wolfram Engine

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2025 Wolfram
© 2025 Wolfram | Legal & Privacy Policy |
English