Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm importing data from Excel. It appears that the sheet number needed in the Import statement is taken from the order that the sheets appear in the open Excel file. I need to import 2 of the sheets from an Excel file. I'd like to do it via the names of the sheets, or at least by some attribute that won't change if I add or delete other sheets or re-order the existing sheets. Can this be done?

share|improve this question
Yes, the XLSX documentation page tells you how. – Sjoerd C. de Vries Aug 1 '13 at 13:49
I am embarrassed. I looked again and there it was. – Mitchell Kaplan Aug 1 '13 at 21:10
up vote 5 down vote accepted
(*show all sheets*)
Import["D:\\allstuff.xls", "Sheets"]
{"portf", "notes", "calc", "xirr", "tx", "JTrade", "Yahoo"}

Import["D:\\stuff.xls", {"Sheets", "portf", 6}]
(*gets 6th row of sheet named "portf"*)

Leave off the 6 to get the whole sheet or say 6,2 to get one cell at 6,B.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.