Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Import multiple excel sheets into in R

  • Difficulty Level : Easy
  • Last Updated : 17 Jun, 2021

In this article, we are going to see how to import multiple Excel sheets into the R language. 

Excel provides us with multiple worksheets. For example, in the below Excel workbook StudentData, we have two worksheets – sheet 1 is Student Details and sheet 2 is Subject Details.

For importing multiple Excel sheets into R, we have to, first install a package in R which is known as readxl. After successfully installing the package, we have to load the package using the library function is R.


Once we have completely installed and loaded the package in RStudio, the next job is to import the excel workbook and check the number of sheet it contains. We can do this using the  excel_sheets function. 


# Importing the excel workbook for
# checking the number of sheets it contains


'StudentDetails' 'SubjectDetails'

We have an Excel file named as “StudentData” and we have already saved it in our working directory. It contains two sheets named StudentDetails and SubjectDetails. We have a function in R called read_excel() which we will use to import specific sheet into R. If no argument is specified, then the read_excel() will by default import the first Excel sheet.

Syntax: read_excel(arg)



# Importing specific sheets into R using the read_excel()
                       sheet = 1)
                       sheet = "StudentDetails")
                       sheet = "SubjectDetails")
# For viewing the details of sheet 1
# For viewing the details of sheet 2


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!