Skip to content

xlsread

Read data from an Excel (.xlsx) file.

num = xlsread(filename)
num = xlsread(filename, sheet)
num = xlsread(filename, sheet, range)
[num, text, raw] = xlsread(filename, ...)

Reads from an Excel workbook. With one argument, reads the first sheet. With sheet (string name or numeric index) selects a sheet. With range (Excel-style range like 'B2:D10') restricts the area read.

Three-output form returns num (numeric data only), text (cells of strings), and raw (the full mixed-type cell array).

num = xlsread('budget.xlsx')
[num, text, raw] = xlsread('data.xlsx', 'Sheet2', 'A1:E20')
  • xlswrite — Write data to an Excel (.xlsx) file.
  • readtable — Read tabular data from a file into a table.